# How do you solve the differential equation given f''(x)=sinx, f'(0)=1, f(0)=6?

Nov 1, 2016

$f \left(x\right) = - \sin x + 2 x + 6$

#### Explanation:

$f ' ' \left(x\right) = \sin x$

Integrating gives us:

$f ' \left(x\right) = \int \sin x \mathrm{dx}$
$\therefore f ' \left(x\right) = - \cos x + {C}_{1}$

Using the initial condition $f ' \left(0\right) = 1 \implies 1 = - \cos 0 + {C}_{1}$
$\therefore 1 = - 1 + {C}_{1} \implies {C}_{1} = 2$

So we have, $f ' \left(x\right) = - \cos x + 2$

Integrating again gives us:
$f \left(x\right) = \int \left(- \cos x + 2\right) \mathrm{dx}$
$\therefore f \left(x\right) = - \sin x + 2 x + {C}_{2}$

Using the initial condition $f \left(0\right) = 6 \implies 6 = - \sin 0 + 0 + {C}_{2}$
$\therefore 6 = 0 + {C}_{2} \implies {C}_{2} = 6$

Hence, The solution to the DE is:
$\therefore f \left(x\right) = - \sin x + 2 x + 6$