# What is the particular solution of the differential equation  y' + y tanx = sin(2x)  where y(0)=1?

Jul 28, 2017

$y = - 2 {\cos}^{2} \left(x\right) + 3 \cos \left(x\right)$

#### Explanation:

The given equation,

$y ' + y \tan \left(x\right) = \sin \left(2 x\right)$

, is of the form:

$y ' + P \left(x\right) y = Q \left(x\right)$

Where $P \left(x\right) = \tan \left(x\right) , \mathmr{and} Q \left(x\right) = \sin \left(2 x\right)$

It is known that the integrating factor is:

$\mu \left(x\right) = {e}^{\int P \left(x\right) \mathrm{dx}}$

$\int \tan \left(x\right) \mathrm{dx} = \log \left(\sec \left(x\right)\right)$

$\mu \left(x\right) = {e}^{\log} \left(\sec \left(x\right)\right) = \sec \left(x\right)$

Multiply the given equation by $\mu \left(x\right)$:

$y ' \sec \left(x\right) + \tan \left(x\right) \sec \left(x\right) y = \sin \frac{2 x}{\sec} \left(x\right)$

We know that the left side integrates to $\mu \left(x\right) y$ and we are left with the task of integrating the right side:

$\sec \left(x\right) y = \int \sin \left(2 x\right) \sec \left(x\right) \mathrm{dx}$

$\sec \left(x\right) y = - 2 \cos \left(x\right) + C$

Multiply both side by $\cos \left(x\right)$

$y = - 2 {\cos}^{2} \left(x\right) + C \cos \left(x\right)$

Use the boundary condition to find the value of C:

$1 = - 2 {\cos}^{2} \left(0\right) + C \cos \left(0\right)$

$C = 3$

Jul 28, 2017

$y = - 2 {\cos}^{2} x + 3 \cos x$

#### Explanation:

We have

$y ' + y \tan x = \sin \left(2 x\right)$

Which can be written:

$y ' + \tan x \setminus y = \sin \left(2 x\right)$

This is a first order linear ordinary differential equation of the form:

$\frac{d \zeta}{\mathrm{dx}} + P \left(x\right) \zeta = Q \left(x\right)$

We solve this using an Integrating Factor

$I = \exp \left(\setminus \int \setminus P \left(x\right) \setminus \mathrm{dx}\right)$
$\setminus \setminus = \exp \left(\int \setminus \left(\tan x\right) \setminus \mathrm{dx}\right)$
$\setminus \setminus = \exp \left(\ln | \sec x |\right)$
$\setminus \setminus = \exp \left(\ln \sec x\right)$
$\setminus \setminus = \sec x$

And if we multiply the DE by this Integrating Factor, $I$, we will have a perfect product differential;

$\sec x y ' + y \sec x \tan x = \sec x \sin \left(2 x\right)$
$\therefore \frac{d}{\mathrm{dx}} \left(y \sec x\right) = \sec x \sin \left(2 x\right)$

Which is now a separable DE, so we can "separate the variables" to get:

$y \sec x = \int \setminus \sec x \sin \left(2 x\right) \setminus \mathrm{dx}$
$\text{ } = \int \setminus \frac{1}{\cos} x \left(2 \sin x \cos x\right) \setminus \mathrm{dx}$
$\text{ } = 2 \setminus \int \setminus \sin x \setminus \mathrm{dx}$

And, Integrating we get:

$y \sec x = - 2 \cos x + C$

$\therefore \frac{y}{\cos} x = - 2 \cos x + C$
$\therefore y = - 2 {\cos}^{2} x + C \cos x$

Which is the general Solution. Then using $y \left(0\right) = 1$ we can find $C$ as:

$1 = - 2 {\cos}^{2} 0 + C \cos 0 \implies 1 = - 2 + C \implies C = 3$

Hence

$\therefore y = - 2 {\cos}^{2} x + 3 \cos x$