# How do you solve the differential equation (dy)/dx=e^(y-x)sec(y)(1+x^2), where y(0)=0 ?

Oct 25, 2014

By separating variables and integrating,

$\int {e}^{- y} \cos y \mathrm{dy} = \int \left(1 + {x}^{2}\right) {e}^{- x} \mathrm{dx}$

Integration by Parts 1
$u = {e}^{- y} \text{ } \mathrm{dv} = \cos y \mathrm{dy}$.
$\mathrm{du} = - {e}^{- y} \mathrm{dy} \text{ } v = \sin y$.

Integration by Parts 2
$u = {e}^{- y} \text{ } \mathrm{dv} = \sin y \mathrm{dy}$.
$\mathrm{du} = - {e}^{- y} \mathrm{dy} \text{ } v = - \cos y$

By Integration by Pats 1,

$\left(L H S\right) = {e}^{- y} \sin y + \int {e}^{- y} \sin y \mathrm{dy}$

by Integration by Parts 2,

$= {e}^{- y} \sin y - {e}^{- y} \cos y - \int {e}^{- y} \cos y \mathrm{dy}$

Since the last integral is the same as $\left(L H S\right)$, we have

$\left(L H S\right) = {e}^{- y} \left(\sin y - \cos y\right) - \left(L H S\right)$

by adding $\left(L H S\right)$,

$R i g h t a r r o w 2 \left(L H S\right) = {e}^{- y} \left(\sin y - \cos y\right)$

by dividing by $2$,

$R i g h t a r r o w \left(L H S\right) = {e}^{- y} / 2 \left(\sin y - \cos y\right)$

Integration by Parts 3
$u = 1 + {x}^{2} \text{ } \mathrm{dv} = {e}^{- x} \mathrm{dx}$
$\mathrm{du} = 2 x \mathrm{dx} \text{ } v = - {e}^{- x}$

Integration by Parts 4
$u = 2 x \text{ } \mathrm{dv} = {e}^{- x} \mathrm{dx}$
$\mathrm{du} = 2 \mathrm{dx} \text{ } v = - {e}^{- x}$

Let us evaluate the right-hand side.

By Integration by Parts 3,

$\left(R H S\right) = - \left(1 + {x}^{2}\right) {e}^{- x} + \int 2 x {e}^{- x} \mathrm{dx}$

by Integration by Parts 4,

$= - \left(1 + {x}^{2}\right) - 2 x {e}^{- x} + \int 2 {e}^{- x} \mathrm{dx}$

$= - \left({x}^{2} + 2 x + 1\right) {e}^{- x} - 2 {e}^{- x} + C$

$= - \left({x}^{2} + 2 x + 3\right) {e}^{- x} + C$

By setting $\left(L H S\right) = \left(R H S\right)$,

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

Since $y \left(0\right) = 0$, we have

$R i g h t a r r o w \frac{1}{2} \left(0 - 1\right) = - 3 + C R i g h t a r r o w C = \frac{5}{2}$

Hence, the solution is implicitly expressed as

${e}^{- y} / 2 \left(\sin y - \cos y\right) = - \left({x}^{2} + 2 x + 3\right) {e}^{- x} + \frac{5}{2}$.

I hope that this was helpful.