3
$\begingroup$

I want to solve an ODE in Mathematica, but there is no response.

This is the code I used:

eqn = x'[y] - c + a x[y] Sin[y - y0]  == 0;
sol = DSolve[eqn, x, y]

Could anyone help me? Is there another function that solves the problem?

$\endgroup$
1

1 Answer 1

4
$\begingroup$

DSolve is hanging on a definite integral with symbolic parameters. We can temporarily inactivate and reactivate Integrate, which in this case causes DSolve to return an indefinite integral that doesn't hang.

eqn = x'[y] - c + a x[y] Sin[y - y0]  == 0;

Block[{Integrate = Inactive[Integrate]},
  DSolve[eqn, x[y], y]
] // Activate

enter image description here

$\endgroup$
2
  • $\begingroup$ What is C[1] in te final answer? $\endgroup$
    – sara nj
    Commented Nov 8, 2016 at 11:41
  • $\begingroup$ @saranj it's an arbitrary constant. It's there because you had no initial condition. $\endgroup$
    – Greg Hurst
    Commented Nov 8, 2016 at 13:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.