Solveeit Logo

Question

Question: What is the general solution of the differential equation \(y'' + y = \cot (x)\)...

What is the general solution of the differential equation y+y=cot(x)y'' + y = \cot (x)

Explanation

Solution

According to the question we have to find the general solution of the given expression. We should know that this is a second-order linear non-homogeneous differential equation. So we should first find the solution, yc{y_c} of the homogeneous equation by comparing it with the auxiliary equation which is the quadratic equation with the coefficients of the derivatives and, then we will find the independent particular solution.
Formula used:
W\left( {{y_1},{y_2}} \right) = \left( {\begin{array}{*{20}{c}} {{y_1}}&{{y_2}} \\\ {y{'_1}}&{y{'_2}} \end{array}} \right)
Formula of the general solution:
y(x)=yc+ypy(x) = {y_c} + {y_p}

Complete answer:
As per the question, we have the differential expression
y+y=cot(x)y'' + y = \cot \left( x \right).
And the auxiliary equation associated with is:
m2+1=0{m^2} + 1 = 0, we know that it has pure imaginary solutions i.e.
m=±im = \pm i
Thus we can say that the general solution of the homogeneous equation is
yc=e0(Acos(1x)+Bsin(1x)){y_c} = {e^0}(A\cos (1x) + B\sin (1x)) , and we know the value e0=1{e^0} = 1 .
Therefore it gives us value
Acosx+BsinxA\cos x + B\sin x .
Now we will solve for the particular solution.
When we get two linearly independent solutions, let us say y1(x),y2(x){y_1}(x),{y_2}(x) , then the particular solution in general of the form
is given by
yp=v1y1+v2y2,{y_p} = {v_1}{y_1} + {v_2}{y_2}, which are all functions of xx .
Where the value of
v1=p(x)y2W[y1,y2]dx{v_1} = - \int {\dfrac{{p(x){y_2}}}{{W[{y_1},{y_2}]}}dx}
And the value of
v2=p(x)y1W[y1,y2]dx{v_2} = \int {\dfrac{{p(x){y_1}}}{{W[{y_1},{y_2}]}}dx}
And we can calculate the value W(y1,y2)W\left( {{y_1},{y_2}} \right) by the formula
\left( {\begin{array}{*{20}{c}} {{y_1}}&{{y_2}} \\\ {y{'_1}}&{y{'_2}} \end{array}} \right)
We also have to find the derivative of both the values.
Here we have y1=cosx{y_1} = \cos x , so its derivative is
y1=sinxy{'_1} = - \sin x
Similarly, we have y2=sinx{y_2} = \sin x , so its derivative is
y2=cosxy{'_2} = \cos x
By substituting the values, we have
W(y1,y2)=1W\left( {{y_1},{y_2}} \right) = 1
Now we can form two particular solutions i.e.
v1=cotxsinx1dx{v_1} = - \int {\dfrac{{\cot x\sin x}}{1}} dx
We can write cotx=cosxsinx\cot x = \dfrac{{\cos x}}{{\sin x}} , so by substituting this we can write the expression as:
cosxsinxsinxdx=cosx\Rightarrow - \int {\dfrac{{\cos x}}{{\sin x}}\sin xdx} = - \int {\cos x}
And now we will simplify and write the derivative of the above expression:
v1=sinx{v_1} = - \sin x
Similarly, we will calculate another value i.e.
v2=cotxcosx1dx{v_2} = \int {\dfrac{{\cot x\cos x}}{1}} dx
Again we can write: cotx=cosxsinx\cot x = \dfrac{{\cos x}}{{\sin x}} , so by substituting this we can write the expression as:
cosxsinxcosxdx=cos2xsinxdx\Rightarrow \int {\dfrac{{\cos x}}{{\sin x}}\cos xdx} = \int {\dfrac{{{{\cos }^2}x}}{{\sin x}}dx}
We can write
cos2x=1sin2x{\cos ^2}x = 1 - {\sin ^2}x
And we know that
1sinx=cscx\dfrac{1}{{\sin x}} = \csc x .
Therefore we have
1sin2xsinxdx\Rightarrow \int {\dfrac{{1 - {{\sin }^2}x}}{{\sin x}}dx}
By splitting the terms we can write:
1sinxsin2xsinxdx\int {\dfrac{1}{{\sin x}} - \dfrac{{{{\sin }^2}x}}{{\sin x}}dx}
It gives us
cscxsinxdx\int {\csc x - \sin xdx}
And now we will solve the derivative of the above expression:
v2=lncscx+cotx+cosx{v_2} = - \ln \left| {\csc x + \cot x} \right| + \cos x
So we can write the particular solution:
yp=v1y1+v2y2{y_p} = {v_1}{y_1} + {v_2}{y_2}
By substituting the values, we can write
=(sinx)(cosx)+(cosxlncscx+cotxsinx= ( - \sin x)(\cos x) + (\cos x - \ln \left| {\csc x + \cot x} \right|\sin x
It then leads us to the general solution of the auxiliary equation i.e.
y(x)=yc+ypy(x) = {y_c} + {y_p}
By substituting the values:
Acosx+Bsinxsinxcosx+sinxcosxsinxlncscx+cotxA\cos x + B\sin x - \sin x\cos x + \sin x\cos x - \sin x\ln \left| {\csc x + \cot x} \right|
Hence it gives us the answer to the question Acosx+Bsinxsinxlncscx+cotxA\cos x + B\sin x - \sin x\ln \left| {\csc x + \cot x} \right| .

Note:
We should note that we have calculated
W(y1,y2)W\left( {{y_1},{y_2}} \right) == \left( {\begin{array}{*{20}{c}} {\cos x}&{\sin x} \\\ { - \sin x}&{\cos x} \end{array}} \right) .
The above expression i.e. matrix is of the form
\left( {\begin{array}{*{20}{c}} a&b; \\\ c&d; \end{array}} \right)
This can be simplified by the formula:
a×db×ca \times d - b \times c
By comparing from the formula here we have:
a=cosxa = \cos x, b=sinxb = \sin x, c=(sinx)c = ( - \sin x), d=cosxd = \cos x
We will now simplify this value:
cosx(cosx)(sinx)(sinx)\cos x(\cos x) - (\sin x)( - \sin x)
On multiplying it gives us
cos2x+sin2x=1\Rightarrow {\cos ^2}x + {\sin ^2}x = 1