In university we are currently learning about Integration by parts and with substitution and one of the Integrals we have to solve is the Integral of the function $\,e^x\!\sin(x)\,$.
From an exercise prior to this one, I know that the derivative of $\,e^x\!\big(\!\cos(x)-\sin(x)\big)$ is $\,e^x(-2)\sin(x)\,.$
So I could potentially show by differentiating the above function twice, that multiplying the second derivative with $\,-\dfrac12\,$ is the integral for $\,e^x\sin(x)\,.\,$ However we have to use Integration by parts (It is not permitted however to use some other technique that parts after integrating by parts at least once)
So the idea I came up with, after I integrated the function already once by parts and the result is
$\displaystyle\cos(x)\!\cdot\!e^x-e^x\!\cdot\!\sin(x)+\int\cos(x)\!\cdot\!e^x\mathrm dx$
to substitute $\,\cos(x)\,$ with $\,-\dfrac32\!\cdot\!\dfrac1{x^2}\,.$
This would result in $\,\displaystyle\int-\dfrac32\left(\dfrac1{x^2}\!\cdot\!e^x-\dfrac1x\!\cdot\!e^x\right)\!\mathrm dx=e^x\!\left(-\dfrac32\!\cdot\!\dfrac1{x^2}+\dfrac32\!\cdot\!\dfrac1x\right).$
Now my question is:
I can put cosine back as the identity without any problems, however, arithmetically, I could not figure out a way to show that $\,-\dfrac32\!\cdot\!\dfrac1x=\sin(x)\,$ based on the substitution I've chosen for cosine.
So is it possible to substitute $\,\dfrac32\!\cdot\!\dfrac1x\,$ back to $\,\sin(x)\,$ just by saying that $\,\dfrac32\!\cdot\!\dfrac1x\,$ is (one of) the stem function(s) for $\,-\dfrac32\!\cdot\!\dfrac1{x^2}\,$ and because $\,\sin(x)\,$ is the stem function for $\,\cos(x)\,,\,$ $\dfrac32\!\cdot\!\dfrac1x\,$ can be written as $\,\sin(x)\,?$
Or would that be considered mathematically faulty?
Thank you in advance for your answers.
Using the integration by parts we have
$u = e^x$ and $dv = \sin(x) dx$. Then, we find $du$ and $v$:
$$ \begin{align*} u &= e^x & \quad &dv = \sin(x) \,dx \\ du &= e^x \,dx & \quad &v = -\cos(x) \end{align*} $$
Now, apply the integration by parts formula:
$$ \int e^x \sin(x) \,dx = -e^x \cos(x) - \int (-\cos(x)) \cdot e^x \,dx$$
Solving the new integral:
Let $u = e^x$ and $dv = -\cos(x) \,dx$. Then, we find $du$ and $v$:
$$ \begin{align*} u &= e^x & \quad &dv = -\cos(x) \,dx \\ du &= e^x \,dx & \quad &v = -\sin(x) \end{align*} $$
Substitute these values into the integration by parts formula:
$$\int -\cos(x) \cdot e^x \,dx = -e^x \sin(x) - \int (-\sin(x)) \cdot e^x \,dx $$
Now, substitute this result back into the initial integration by parts formula:
$$\int e^x \sin(x) \,dx = -e^x \cos(x) + e^x \sin(x) - \int e^x \sin(x) \,dx $$
Add $\int e^x \sin(x) \,dx$ to both sides:
$$2 \int e^x \sin(x) \,dx = -e^x \cos(x) + e^x \sin(x)$$
Divide both sides by $2$:
$$ \int e^x \sin(x) \,dx = -\frac{1}{2}e^x \cos(x) + \frac{1}{2}e^x \sin(x) + C $$
where $C$ is the constant of integration.