hi, I'm trying to solve this ODE with the SymPy:
dsolve(Eq(Derivative(f(x), x), ((1+3 * x**2) / (3 * f(x) + 6))), f(x), ics={f(0):1})
and it it prints out
_________________ _________________
/ 3 / 3
\/ C1 + 6*x + 6*x \/ C1 + 6*x + 6*x
[f(x) = - -------------------- - 2, f(x) = -------------------- - 2]
3 3
...it doesn't eliminate the constant C1, it doesn't use the initial condition. Is it a bug or wrong usage?
In [1]: sol = dsolve(Eq(Derivative(f(x), x), ((1+3 * x**2) / (3 * f(x) + 6))), f(x), ics={f(0):1})
In [2]: sol
Out[2]:
_____________ _____________
___ / 3 ___ / 3
\/ 6 *\/ C1 + x + x \/ 6 *\/ C1 + x + x
[f(x) = - ---------------------- - 2, f(x) = ---------------------- - 2]
3 3
In [6]: C1 = symbols("C1")
In [7]: solve(sol[0].args[1].subs(x, 0) - 1, C1)
Out[7]: []
In [8]: solve(sol[1].args[1].subs(x, 0) - 1, C1)
Out[8]: [27/2]
In [10]: sol[1].subs(C1, _[0])
Out[10]:
_____________
___ / 3 27
\/ 6 * / x + x + --
\/ 2
f(x) = ----------------------- - 2
3