1
$\begingroup$

After solving an ODE with 'Solve' function, I'm getting a result as

enter image description here

Now I know that the coefficients $c_1, c_2$ have to be zero when I impose further restrictions on the solution, so after obtaining the above solution, how I can set the coefficients $c_1, c_2$ to zero so that I will only have the last term on the solution?

$\endgroup$
2
  • 2
    $\begingroup$ Assuming sol is the solution, Try: sol2 = sol /. {C[1] -> 0, C[2] -> 0} $\endgroup$
    – Syed
    Nov 11, 2021 at 11:32
  • 4
    $\begingroup$ and if you want to do it for any ode order solution you can try sol /. C[_Integer] :> 0 btw, the title of your question should be DSolve not Solve $\endgroup$
    – Nasser
    Nov 11, 2021 at 11:44

0

Browse other questions tagged or ask your own question.