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

Oct 24, 2017

$A \cos x + B \sin x - \sin x \ln | \csc x + \cot x |$

#### Explanation:

We have:

$y ' ' + y = \cot \left(x\right)$ ..... [A]

This is a second order linear non-Homogeneous Differentiation Equation. The standard approach is to find a solution, ${y}_{c}$ of the homogeneous equation by looking at the Auxiliary Equation, which is the quadratic equation with the coefficients of the derivatives, and then finding an independent particular solution, ${y}_{p}$ of the non-homogeneous equation.

Complementary Function

The homogeneous equation associated with [A] is

$y ' ' + 9 y = 0$

And it's associated Auxiliary equation is:

${m}^{2} + 1 = 0$

Which has pure imaginary solutions $m = \pm i$

Thus the solution of the homogeneous equation is:

${y}_{c} = {e}^{0} \left(A \cos \left(1 x\right) + B \sin \left(1 x\right)\right)$
$\setminus \setminus \setminus = A \cos x + B \sin x$

Particular Solution

With this particular equation [A], the interesting part is find the solution of the particular function. We would typically use practice & experience to "guess" the form of the solution but that approach is likely to fail here. Instead we must use the Wronskian. It does, however, involve a lot more work:

Once we have two linearly independent solutions say ${y}_{1} \left(x\right)$ and ${y}_{2} \left(x\right)$ then the particular solution of the general DE;

$a y ' ' + b y ' + c y = p \left(x\right)$

is given by:

${y}_{p} = {v}_{1} {y}_{1} + {v}_{2} {y}_{2} \setminus \setminus$, which are all functions of $x$

Where:

${v}_{1} = - \int \setminus \frac{p \left(x\right) {y}_{2}}{W \left[{y}_{1} , {y}_{2}\right]} \setminus \mathrm{dx}$
${v}_{2} = \setminus \setminus \setminus \setminus \setminus \int \setminus \frac{p \left(x\right) {y}_{1}}{W \left[{y}_{1} , {y}_{2}\right]} \setminus \mathrm{dx}$

And, $W \left[{y}_{1} , {y}_{2}\right]$ is the wronskian; defined by the following determinant:

$W \left[{y}_{1} , {y}_{2}\right] = | \left({y}_{1} , {y}_{2}\right) , \left(y {'}_{1} , y {'}_{2}\right) |$

So for our equation [A]:

$p \left(x\right) = \cot x$
${y}_{1} \setminus \setminus \setminus = \cos x \implies y {'}_{1} = - \sin x$
${y}_{2} \setminus \setminus \setminus = \sin x \implies y {'}_{2} = \cos x$

So the wronskian for this equation is:

$W \left[{y}_{1} , {y}_{2}\right] = | \left(\cos x , , \sin x\right) , \left(- \sin x , , \cos x\right) |$

$\text{ } = \left(\cos x\right) \left(\cos x\right) - \left(\sin x\right) \left(- \sin x\right)$
$\text{ } = {\cos}^{2} x + {\sin}^{2} x$
$\text{ } = 1$

So we form the two particular solution function:

${v}_{1} = - \int \setminus \frac{p \left(x\right) {y}_{2}}{W \left[{y}_{1} , {y}_{2}\right]} \setminus \mathrm{dx}$

$\setminus \setminus \setminus = - \int \setminus \frac{\cot x \sin x}{1} \setminus \mathrm{dx}$
$\setminus \setminus \setminus = - \int \setminus \cos \frac{x}{\sin} x \sin x \setminus \mathrm{dx}$
$\setminus \setminus \setminus = - \int \setminus \cos x \setminus \mathrm{dx}$
$\setminus \setminus \setminus = - \sin x$

And;

${v}_{2} = \setminus \setminus \setminus \setminus \setminus \int \setminus \frac{p \left(x\right) {y}_{1}}{W \left[{y}_{1} , {y}_{2}\right]} \setminus \mathrm{dx}$

$\setminus \setminus \setminus = \int \setminus \frac{\cot x \cos x}{1} \setminus \mathrm{dx}$
$\setminus \setminus \setminus = \int \setminus \cos \frac{x}{\sin} x \cos x \setminus \mathrm{dx}$
$\setminus \setminus \setminus = \int \setminus {\cos}^{2} \frac{x}{\sin} x \setminus \mathrm{dx}$
$\setminus \setminus \setminus = \int \setminus \frac{1 - {\sin}^{2} x}{\sin} x \setminus \mathrm{dx}$
$\setminus \setminus \setminus = \int \setminus \csc x - \sin x \setminus \mathrm{dx}$
$\setminus \setminus \setminus = - \ln | \csc x + \cot x | + \cos x$

And so we form the Particular solution:

${y}_{p} = {v}_{1} {y}_{1} + {v}_{2} {y}_{2}$
$\setminus \setminus \setminus = \left(- \sin x\right) \left(\cos x\right) + \left(\cos x - \ln | \csc x + \cot x |\right) \sin x$

Which then leads to the GS of [A}

$y \left(x\right) = {y}_{c} + {y}_{p}$
$\setminus \setminus \setminus \setminus \setminus \setminus \setminus = A \cos x + B \sin x - \sin x \cos x + \sin x \cos x - \sin x \ln | \csc x + \cot x |$
$\setminus \setminus \setminus \setminus \setminus \setminus \setminus = A \cos x + B \sin x - \sin x \ln | \csc x + \cot x |$