Integrating $x \sin(nx)$

1.2k Views Asked by At

It should be simple but I'm overthinking this so hard, that I can't see what I'm supposed to do anymore. Instead of taking a break from it, I'll ask here.

$\int x\sin(nx) \, dx$, $\sin(nx)$ would be $\frac{-\cos(nx)}{n}$ if I'm not very mistaken, but what should I set as $u$ and $v'$ here?

Thing is, this is part of a Fourier series calculation of an odd function, where this is $b_n$ (and also the whole Fourier series), and the limits are $0$ and $\frac{\pi}{2}$.

I'm also getting confused when I get $\frac{\pi}{2}$ for $\sin(nx)$ and $-\cos(nx)$, as these would vary between $-1$, $0$ and $1$. I might be overthinking ahead of what I've already calculated here, so it might be some stuff I can cross out that I can't see just now.

1

There are 1 best solutions below

4
On BEST ANSWER

You can do it as follows\begin{align}\int\overbrace{x}^{\phantom u=u}\overbrace{\sin(nx)}^{\phantom{v'}=v'}\,\mathrm dx&=-x\frac{\cos(nx)}n+\int\frac{\cos(nx)}n\,\mathrm dx\\&=-x\frac{\cos(nx)}n+\frac{\sin(nx)}{n^2}+C.\end{align}