|
33 | 33 |
|
34 | 34 | """
|
35 | 35 | from sympy import (acos, asin, atan, cos, Derivative, Dummy, diff,
|
36 |
| - E, Eq, exp, I, LambertW, log, pi, Piecewise, Rational, S, sin, sinh, tan, |
| 36 | + E, Eq, exp, I, Integral, integrate, LambertW, log, pi, Piecewise, Rational, S, sin, sinh, tan, |
37 | 37 | sqrt, symbols, Ei, erfi)
|
38 | 38 |
|
39 | 39 | from sympy.core import Function, Symbol
|
@@ -322,6 +322,9 @@ def test_nth_algebraic():
|
322 | 322 |
|
323 | 323 | @slow
|
324 | 324 | def test_slow_examples_1st_exact():
|
| 325 | + eq = cos(f(x)) - (x*sin(f(x)) - f(x)**2)*f(x).diff(x) |
| 326 | + sol_1 = dsolve(eq, f(x), simplify=False, hint='1st_exact_Integral') |
| 327 | + assert checkodesol(eq, sol_1, order=1, solve_for_func=False) |
325 | 328 | _ode_solver_test(_get_examples_ode_sol_1st_exact(), run_slow_test=True)
|
326 | 329 |
|
327 | 330 |
|
@@ -364,6 +367,7 @@ def test_separable():
|
364 | 367 |
|
365 | 368 |
|
366 | 369 | def test_factorable():
|
| 370 | + assert integrate(-asin(f(2*x)+pi), x) == -Integral(asin(pi + f(2*x)), x) |
367 | 371 | _ode_solver_test(_get_examples_ode_sol_factorable())
|
368 | 372 |
|
369 | 373 |
|
@@ -608,6 +612,7 @@ def _get_examples_ode_sol_factorable():
|
608 | 612 | nth_linear_constant_coeff_undetermined_coefficients"""
|
609 | 613 |
|
610 | 614 | y = Dummy('y')
|
| 615 | + a0,a1,a2,a3,a4 = symbols('a0, a1, a2, a3, a4') |
611 | 616 | return {
|
612 | 617 | 'hint': "factorable",
|
613 | 618 | 'func': f(x),
|
@@ -710,6 +715,19 @@ def _get_examples_ode_sol_factorable():
|
710 | 715 | 'eq': f(x).diff(x)**2 - f(x)**3,
|
711 | 716 | 'sol': [Eq(f(x), 4/(C1**2 - 2*C1*x + x**2))]
|
712 | 717 | },
|
| 718 | + |
| 719 | + # kamke ode 1.1 |
| 720 | + 'fact_17': { |
| 721 | + 'eq': f(x).diff(x)-(a4*x**4 + a3*x**3 + a2*x**2 + a1*x + a0)**(-1/2), |
| 722 | + 'sol': [Eq(f(x), C1 + Integral(1/sqrt(a0 + a1*x + a2*x**2 + a3*x**3 + a4*x**4), x))] |
| 723 | + }, |
| 724 | + |
| 725 | + # This is from issue: https://github.com/sympy/sympy/issues/9446 |
| 726 | + 'fact_18':{ |
| 727 | + 'eq': Eq(f(2 * x), sin(Derivative(f(x)))), |
| 728 | + 'sol': [Eq(f(x), C1 + pi*x - Integral(asin(f(2*x)), x)), Eq(f(x), C1 + Integral(asin(f(2*x)), x))], |
| 729 | + 'checkodesol_XFAIL':True |
| 730 | + }, |
713 | 731 | }
|
714 | 732 | }
|
715 | 733 |
|
@@ -1331,6 +1349,13 @@ def _get_examples_ode_sol_1st_exact():
|
1331 | 1349 | 'slow': True,
|
1332 | 1350 | 'simplify_flag':False
|
1333 | 1351 | },
|
| 1352 | + |
| 1353 | + # This was from issue: https://github.com/sympy/sympy/issues/11290 |
| 1354 | + '1st_exact_06': { |
| 1355 | + 'eq': cos(f(x)) - (x*sin(f(x)) - f(x)**2)*f(x).diff(x), |
| 1356 | + 'sol': [Eq(x*cos(f(x)) + f(x)**3/3, C1)], |
| 1357 | + 'simplify_flag':False |
| 1358 | + }, |
1334 | 1359 | }
|
1335 | 1360 | }
|
1336 | 1361 |
|
|
0 commit comments