Hello Tolis.
The characterstic polynomial of the first equation is the \(\displaystyle{f(y)=y^2+5\,y+6\,y\in\mathbb{C}_[y]}\) with
\(\displaystyle{f(y)=0\iff y^2+5\,y+6=0\iff \left(y+2\right)\,\left(y+3\right)=0\iff y=3\,\,\lor\,\,y=2}\) .
So, the general solution of tthe equation is \(\displaystyle{f(x)=c_1\,e^{3\,x}+c_2\,e^{2\,x}\,,x\in\mathbb{R}}\) .
Since \(\displaystyle{f(0)=2}\), we get : \(\displaystyle{c_1+c_2=2}\) . Also,
\(\displaystyle{f^\prime(x)=3\,c_1\,e^{3\,x}2\,c_2\,e^{2\,x}\,,x\in\mathbb{R}}\) and then :
\(\displaystyle{f^\prime(0)=3\iff 3\,c_12\,c_2=3\iff 3\,(2c_2)2\,c_2=3\iff c_2=9\implies c_1=7}\), so :
\(\displaystyle{f:\mathbb{R}\longrightarrow \mathbb{R}\,,f(x)=7\,e^{3\,x}+9\,e^{2\,x}}\) .
Now, for the second equation :
Consider the equation \(\displaystyle{f^{\prime \prime}(x)+f(x)=0}\) with characteristic polynomial
\(\displaystyle{g(y)=y^2+1}\) and \(\displaystyle{g(y)=0\iff y=\pm i}\), so :
the general solution of the second equation is
\(\displaystyle{f(x)=h(x)+k_1\,\cos\,x+k_2\,\sin\,x\,,x\in\mathbb{R}}\) , where
\(\displaystyle{h}\) is a partial solution of \(\displaystyle{f^{\prime \prime}(x)+f(x)=\sin\,(2\,x)}\) given by :
\(\displaystyle{h(x)=\int_{0}^{x}\dfrac{\cos\,t\,\sin\,x\sin\,t\,\cos\,x}{\cos^2\,t+\sin^2\,t}\cdot \sin\,(2\,t)\,\mathrm{d}t=...=\dfrac{1}{3}\,\sin\,x\dfrac{1}{3}\,\sin\,(2\,x)\,,x\in\mathbb{R}}\) .
