By FTC, we know that integration undoes differentiation. That is,
\begin{equation*}
f'(x) = \int f''(x) \, dx
\hspace{20px}\text{ and }\hspace{20px}
f(x) = \int f'(x) \, dx
\end{equation*}
So letβs start on taking the integrals!
\begin{align*}
f'(x) = \int f''(x) \, dx \amp= \int \left( x - \cos(x) \right) \, dx\\
\amp= \int x \, dx - \int \cos(x)\, dx \amp\amp \text{by the Linearity of Integrals}\\
\amp= \frac{x^2}{2} - \sin(x) + C_1 \amp\amp \text{by the Power Rule and Trig Rule}
\end{align*}
We can determine what \(f'(x)\) is specifically using the initial condition \(f'(0) = 2\text{.}\) That is,
\begin{equation*}
2 = f'(0) = \frac{0^2}{2} - \sin(0) + C_1
\hspace{20px}\implies\hspace{20px}
C_1 = 2
\end{equation*}
Hence, we know that
\(f'(x) = \dfrac{x^2}{2} - \sin(x) + 2\text{.}\) We can take one more integral to obtain
\(f(x)\text{.}\)
\begin{align*}
f(x) = \int f'(x) \, dx \amp= \int \left( \frac{x^2}{2} - \sin(x) + 2 \right) \, dx\\
\amp= \frac{1}{2} \int x^2 \, dx - \int \sin(x)\, dx + 2 \int \, dx \amp\amp \text{by the Linearity of Integrals}\\
\amp= \frac{x^3}{6} + \cos(x) + 2x + C_2 \amp\amp \text{by the Power Rule and Trig Rule}
\end{align*}
We can determine what \(f(x)\) is specifically using the initial condition \(f(0) = -2\text{.}\) That is,
\begin{equation*}
-2 = f(0) = \frac{0^3}{6} + \cos(0) + 2(0) + C_2
\hspace{20px}\implies\hspace{20px}
C_2 = -3
\end{equation*}
Hence, we know that
\(f(t) = \dfrac{x^3}{6} + \cos(x) + 2x - 3\text{.}\)