Find the general solution of $y' \cot x +y =2$

849 Views Asked by At

How do you start by finding the general solution? And then finding the integration constant using the initial condition $y(0)=1$

So far I've got...

$$y' \cot x +y = 2\\\frac{dy}{2}-y = \tan x dx\\\int \frac{dy}{2}-y = \int \tan x dx\\-\ln(2-y) =-\ln|\cos x| + C$$

Is this right and what are the next steps?

1

There are 1 best solutions below

7
On

Solving a Separable First Order ODE Using Initial Conditions

Your solution looks right so far.

The next step would be to use the initial condition given, y(0) =1. Which is translated to mean that when x=0 then y=1. By substituting this into the general equation you have already found, the sole, remaining unknown C can be solved for. In this case it looks like C=0

Edit: After arriving at: $-ln(2-y) = -ln|cos x| + C$

Taking the exponents on both sides will give: $e^{ln(2-y)^{-1}} = e^{(ln|cos x|^{-1} + C)}$

Which, using the laws of exponents, can be written as:

$e^{ln(2-y)^{-1}} = e^Ce^{ln|cos x|^{-1}}$

And simplified to be: $(2-y)^{-1}= e^C|cos x|^{-1}$

$\frac{1}{2-y}= e^C \frac{1}{|cos x|}$

$y = 2-\frac{ |cos x| }{e^C} $

Again, as before, using the initial condition given, $y(0) =1$ (that is $y=1$ when $x=0$) - we find that $C = 0$ or $e^C = 1$.