# Solve the differential equation $\sin x\frac {dy}{dx}+(\cos x)y=\sin(x^2)$ [closed]

$$\sin x\frac {dy}{dx}+(\cos x)y=\sin(x^2)$$ $$\frac {d}{dx} y \sin x=\sin(x^2)$$ $$y\sin x=\int \sin(x^2)dx = -\frac{1}{2x}\cos(x^2)+C$$ $$y=-\frac{\cos(x^2)}{2x\sin x}+\frac {C}{\sin x}$$ where C is constant

• You cannot integrate $\sin(x^2)$ to get $-\frac1{2x}\cos(x^2)$! If you differentiate this result, you will not end up back at $\sin(x^2)$. In fact, integrating $\sin(x^2)$ is very hard, and probably requires some special functions. Where did you find this problem? – John Doe Jan 5 '19 at 13:52
• It is $sin(x^2)$. This question is in my textbook. – Maggie Jan 5 '19 at 13:55
• Maybe there is a typo. What is the result given by your textbook? – Robert Z Jan 5 '19 at 13:59
• The answer is $y=\frac {\int sin(x^2)dx+C}{sinx}$. I don't know why the constant C is there. – Maggie Jan 5 '19 at 13:59
• The constant $C$ is just a constant of integration. You could just include it in the integral if you really wanted, so I'd agree that it is not necessary to write there. – John Doe Jan 5 '19 at 14:03

The answer given in your textbook is correct - you have tried to oversimplify it! You got to $$\frac {d}{dx} y \sin x=\sin(x^2)$$Then you integrate both sides $$y\sin x=\int\sin(x^2) \mathrm dx+C$$Then you divide by $$\sin x$$ to get $$y=\frac{\int\sin(x^2)\mathrm dx+C}{\sin x}$$

as required.

There is no need to try and integrate the $$\sin(x^2)$$ term, the way you did it is not correct. To check why this is the case, try to differentiate your result. If you had done it correctly, it would give you $$\sin(x^2)$$. However, what it really gives you is $$\sin(x^2)+\frac{\cos(x^2)}{2x^2}$$so there has been a mistake.

• Thanks! I will check my integral next time carefully. You help me a lot. – Maggie Jan 5 '19 at 14:09

The obeservation you have done is pretty good! You have correctly identified the LHS as an application of the product rule since

$$\frac{\mathrm d}{\mathrm d x}\left(y\sin(x)\right)=\frac{\mathrm d y}{\mathrm d x}\sin(x)+y\cos(x)$$

However, without trying to discourage you but the integration of $$\sin(x^2)$$ is sadly speaking not that simple. You can check that you conjectured anti-derivative is wrong by simple taking the derivative. Thus, the whole solution is given by the following

\begin{align*} \frac{\mathrm d y}{\mathrm d x}\sin(x)+y\cos(x)&=\sin(x^2)\\ \frac{\mathrm d}{\mathrm d x}\left(y\sin(x)\right)&=\sin(x^2)\\ y\sin(x)&=\int\sin(x^2)\mathrm d x+C \end{align*}

$$\therefore~y(x)~=~\frac1{\sin(x)}\left(\int\sin(x^2)\mathrm d x+C\right)$$

Adding some details concerning the still remaining integral: According to WolframAlpha the integral can be written in terms of the special function Fresnel Integral. For a straightforward "solution" you can expand the sine as a series and integrate termwise. On the other hand for definite integrals there are some value known, the I would say most important is

$$\int_0^\infty \sin(x^2)\mathrm d x~=~\frac{\sqrt{\pi}}{2\sqrt 2}$$