I have to find the general solution of the differential equation:$ y$' $cot$ $x$ + $y$ = $2$. And determine the integration constant using the initial condition $y$(0) = $1$. Additionally presenting it in a explicit form.
Just wondering how I am going and if I am on the right track cheers,
First re-write $y$' $cot$ $x$ + $y$ = $2$ in the standard form. $y$^' $cot$$x$+$y$=$2$ $y$^'+$y$/cot$x$ =$2$/$cotx$ $y$^'+$y$tan $x$=$2$ $tan$$x$
Therefore form the equation, $p$(x)=tan$x$ and, $q$(x)=$2$ tan$x$ Finding the integrating factor, $I$(x)≡$e^∫p$(x)$dx$=$e$^∫$tan$〖$x$ $dx$〗 =$e$^(-ln|$cos$$x$ | )
Multiplying integrating factor into the standard form,
〖$e$^(-ln|$cos$$x$ | ) $y$〗^'+($ye$^($-ln$|$cosx$ | ))/$cotx$ =〖$2e$〗^(-$ln$|$cosx$ | )/$cotx$
With the equation being in the form of.
$d/dx$ ($e$^($-ln$|$cosx$ | )$ y$)= 〖$2e$〗^($-ln$|$cosx$ | )/$cotx$
$d/dx$ ($e$^($-ln$|$cosx$ | ) $y$)= 〖$2e$〗^($-ln$|$cosx$ | ) $tanx$
Then integrating this equation produces,
∫〖$d/dx$ ($e$^($-ln$|$cosx$ | ) $y$)=∫〖〖$2e$〗^($-ln$|$cosx$ | ) $tanx$ 〗〗
($e$^($-ln$|$cosx$ | ) $y$)=∫〖〖$2e$〗^($-ln$|$cosx$ | ) $tanx$ 〗
=$2$∫〖$e$^($-ln$|$cosx$ | ) $tanx$ 〗
focusing on ∫〖$e$^($-ln$|$cosx$ | ) $tanx$ 〗
∫〖$e$^($-ln$|$cosx$ | ) $tanx$ 〗=($e$^($-ln$|$cosx$ | )∙$-ln$|$cosx$ | )-($e$^($-ln$|$cosx$ | )∙$tanx$ )
=($e$^($-ln$|$cosx$ | )∙$-ln$|$cosx$ | )-($e$^($-ln$|$cosx$ | )∙$tanx$ )
There's an easier way to do this problem without integrating factors. Notice that this equation is separable and can be written in the form
$$ \frac{dy}{2-y} \;\; =\;\; \tan x dx. $$
Recalling that $\int \tan xdx = -\ln|\cos x| + C$ and noting that $\int\frac{dy}{2-y} = -\ln(2-y)$, finding the solution should be easier now.