I am asked to solve the following differential equation:

$$y' = y \tan(x) + \cot(x)$$

What I have so far is

$$ \begin{align*} y' - (\tan x) y &= \cot(x)\\ \\ I &= e^{\int - \tan(x) dx} = \cos(x)\\ \\ \cos(x) \left( y' - y \tan(x) \right) &= \cos(x) \cot(x)\\ y' \cos(x) - y \sin(x) &= \cos(x) \cot(x)\\ \int y' \cos(x) - y \sin(x) &= \int \cos(x) \cot(x) dx\\ \\ y \cos(x) &= \int \frac{cos^2(x)}{\sin(x)}\\ y \cos(x) &= \int \frac{1-sin^2(x)}{\sin(x)}\\ &= \int \csc(x) - \sin(x) \ dx\\ &= - \ln \vert \csc(x) + \cot(x) \vert + \cos(x) + C\\ \\ \therefore y &= - \frac{\ln \vert \csc(x) + \cot(x) \vert}{\cos(x)} + 1 + C \sec(x) \end{align*} $$

The thing is: I am having a hard time comparing my result to the textbook's solution and to Wolfram's solution.

Textbook's solution: $$\sec(x) \left( \frac{x}{2} + \frac{\sin(2x)}{4} + C \right)$$

Is my solution correct?

Thank you.

  • $\begingroup$ Your answer is correct and is equivalent to WA's. The textbook answer is wrong $\endgroup$ – David Quinn Aug 9 '16 at 19:41
  • $\begingroup$ Hi @DavidQuinn thank you for your input. How could I go from my answer to Wolfram's (or the opposite)? What kind of transformation did you do? $\endgroup$ – bru1987 Aug 9 '16 at 19:42
  • 1
    $\begingroup$ Use $\csc x+\cot x=\cot(\frac x2)$ $\endgroup$ – David Quinn Aug 9 '16 at 19:50

To explain the textbook's answer, note that in that case one would have

\begin{align} y'(x)-y \tan x &=\sec x \tan x \left( \frac{x}{2} + \frac{\sin 2x }{4} + C \right)+\sec x \left( \frac{1}{2} + \frac{\cos 2x }{2} \right) \\&\hspace{4mm} -\sec x\left(\frac{x}{2}+\frac{\sin 2x }{4} + C \right)\tan x \\ &= \frac{1 + \cos 2x }{2\cos x}\\&=\cos x \end{align} i.e. the textbook's answer is for the RHS being $\cos x$ rather than $\cot x$.

  • $\begingroup$ awesome, thank you! Best Regards. $\endgroup$ – bru1987 Aug 9 '16 at 20:25

Since $\ln \vert \csc(x) + \cot(x) \vert=\ln{|\frac{1+\cos{x}}{\sin{x}}|}=\ln{|\frac{2\cos^2{(x/2)}}{2\sin{(x/2)\cos(x/2)}}|}=\ln{\cos{(x/2)}}-\ln{\sin(x/2)}$, your solution is same as WolphramAlpha's.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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