I am studying damped oscillations and forced oscillations in physics which are represented by the following differential equations in order.
$$\begin{align}m\dfrac{\mathrm d^2x}{\mathrm dt^2}+b\dfrac{\mathrm dx}{\mathrm dt}+kx&=0 \tag1\\m \dfrac{\mathrm d^2x}{\mathrm dt^2}+b\dfrac{\mathrm dx}{\mathrm dt}+kx&=F_0\cos(\omega_dt)\tag2\end{align}$$
I am not very much familiar with solving $2$nd order differential equations. I am able to solve equation $(1)$ by intuition. But solving equation $(2)$ seems complicated. It would be helpful if I could get a demonstration of the procedure to solving this type of ODE. Thanks
Edit $1$
I looked up the method of using Laplace transform to solving differential equations. I tried doing the first one using that.
Attempt
$$\begin{aligned}mx''(t)+bx'(t)+kx&=0\\ m\mathcal{L}\{x''\}+b\mathcal{L}\{x'\}+k\mathcal{L}\{x\}&=0\\ \mathcal{L}\{x\}&=A_0\frac{(ms+b)\sin\delta+m}{ms^2+bs-k}\end{aligned}$$
Is that right? Would now taking the inverse Laplace transform give me $x(t)=A_0e^{-bt/2m}\sin(\omega t+\delta)$ where $\omega^2=k/m-b^2/4m^2$? Thanks
You can use Laplace transform if you can. It is the easiest way of solving linear differential equations, I think.
Taking laplace transform of both sides, by noting that $X(s)$ is the Laplace transform of $x(t)$ and Laplace transform of the derivative of $x(t)$ is multiplication by $s$ in Laplace domain (if initial conditions are zero):
\begin{equation*} ms^2X(s)+bsX(s)+kX(s)=F_0 L(cos(\omega_d t))=\frac{1}{2}F_0 L(e^{j \omega_d t} + e^{-j \omega_d t}) = \frac{1}{2}F_0(\frac{1}{s-j\omega_d}+\frac{1}{s+j\omega_d}) \end{equation*}
\begin{equation*} X(s) = \frac{1}{2}F_0 (\frac{1}{s-j\omega_d}+\frac{1}{s+j\omega_d}) \frac{1}{ms^2+bs+k} \end{equation*}
(For finding the laplace of $e^{j\omega_d t}$, please see the first equation below).
From this point on, you know the Laplace transform $X(s)$. For finding the inverse Laplace transform, we decompose $X(s)$ into partial fractions, and then use Laplace table for primitive functions to find the inverse Laplace by inspection. Just look at the inverse Laplace of terms like $\frac{1}{s-a}$ or $\frac{1}{(s-a)^n}$ in the table, and note that Laplace transform is a linear transformation (that is you can do superposition). Here are the useful terms from the table:
\begin{equation*} L^{-1}(\frac{c}{s+p})=ce^{-pt} \end{equation*}
\begin{equation*} L^{-1}(\frac{c}{(s+p)^n})=c\frac{t^{n-1}}{(n-1)!}e^{-pt} \end{equation*}
This way you find the $x(t)$. Here note that you can get complex numbers as $p$ can be complex. However, as ODE has real coefficients, they come in conjugate pairs and add up to a real function.