I am trying to find the Laplace transform of $\sin(\omega t + \phi)$. My work is as follows:
$$\begin{align} \mathcal{L} \{ \sin(\omega t + \phi) \} &= \int_0^\infty [\sin(\omega t + \phi)] e^{-st} \ dt \\ &= \left[ \dfrac{-1}{s} e^{-st} \sin(\omega t + \phi) \right]^\infty_0 + \dfrac{\omega}{s} \int_0^\infty e^{-st} \cos(\omega t + \phi) \ dt \\ &= \dfrac{-1}{s} \sin(\phi) + \dfrac{\omega}{s} \int_0^\infty e^{-st} \cos(\omega t +\phi) \ dt \ \ \ \text{(Assuming $\Re\{s\} > 0$.)} \end{align}$$
As can be seen, we end up with the similar integral $\dfrac{\omega}{s} \int_0^\infty e^{-st} \cos(\omega t +\phi) \ dt$, which indicates that we are stuck in an infinite loop of integration by parts'. Checking my textbook solutions, the author says the following:
This integral is evaluated by integrating by parts twice using the following trick. Let
$$I = \int_0^\infty e^{-st} \sin(\omega t + \phi) \ dt$$
Then derive the formula
$$I = \left[ - \dfrac{1}{s} e^{-st} \sin(\omega t + \phi) - \dfrac{\omega}{s^2}e^{-st} \cos(\omega t + \phi) \right]^\infty_0 - \dfrac{\omega^2}{s^2} I,$$
from which
$$I = \dfrac{s \sin(\phi) + \omega \cos(\phi)}{s^2 + \omega^2}.$$
I find the author's entire explanation of the solution lacking. I do not recall ever encountering this "trick" before in any of my integration work. So firstly, what is this "trick" and why is it used? And the author jumps from one equation to the other, without any explanation for the steps in between. So secondly, how are both of the equations for $I$ derived from the integral equation of $I$? I would greatly appreciate it if people would please take the time to clarify this solution.
Self-similar integrals are somewhat common and are often used to evaluate definite integrals. If you have an equation of the form $$ I = \text{stuff} - k I, $$ then $I= \text{stuff}/(1+k)$. As an example, let's do IBP twice on $\int e^x\sin(x)$, with $dv=e^xdx$. $$ I = \int e^x \sin(x)\,dx = e^x \sin(x)- \int e^x\cos(x)\,dx = e^x \sin(x) - \left(e^x\cos(x)-\int e^x (-\sin(x))\,dx\right) $$ $$ I = e^x \sin(x) - e^x\cos(x)- I;\qquad I = \frac{e^x \sin(x) - e^x\cos(x)}{2}+C $$If you buy this example, try working through yours again; the bounds shouldn't post too many problems. Another famous example is Serret's Integral: $$ S = \int _0^1 \frac{\log(x+1)}{x^2+1}\,dx $$Using the substitution $y=2\left(1-\frac{1}{x+1}\right)$ and doing some algebra allows $S$ to be written as $$ S = \int _{0}^{1} \frac{\log(2)}{(1-y)^2+1}\,dy - \int _{0}^{1} \frac{\log(2-y)}{(1-y)^2+1}\,dy; $$ $$ S = \frac{\pi \log(2)}{4}-S,\qquad S = \frac{\pi \log(2)}{8} $$