integral from-pi to pi of x*sin(n*x)
1) The math expression: x·sin(nx) contains several variables so the variable: x is chosen for integral computation
Let's integrate: ∫(x·sin(nx))dx
For x·sin(nx), we use integration by parts: ∫(u1·v2')dx = u1·v2 -∫(u1'·v2)dx, with u1 = x and v2' = sin(nx)
Thus, u1' is 1
2) Let's compute the integral v2': ∫(sin(nx))dx
For the math expression: sin(nx), we know the derivative formula: ddx(cos(a)) = -sin(a), so we try differentiating with cos
3) Let's perform the differentiation: ddx(cos(nx))
We differentiate using: ddx(cos(f)) = -ddx(f)·sin(f) (where f = nx)
-ddx(nx)·sin(nx)
-n·sin(nx)
You observe that the computed derivative and the original math expression are the same, except for a coefficient. So the integral is:
1-n·cos(nx)
-1n·cos(nx)
-cos(nx)n
So the value of v2 is -cos(nx)n
4) Let's compute the integral u1·v2 -∫(u1'·v2)dx: x·(-cos(nx)n) -∫(-cos(nx)n)dx
For the math expression: cos(nx)n, we know the derivative formula: ddx(sin(a)) = cos(a), so we try differentiating with sin
5) Let's differentiate: ddx(sin(nx))
Apply the differentiation rule: ddx(sin(f)) = ddx(f)·cos(f) with f = nx
ddx(nx)·cos(nx)
n·cos(nx)
The computed derivative matches the original math expression up to a constant factor. Therefore, the integral is:
-x·cos(nx)n + 1n2·sin(nx)
▷ -x·cos(nx)n + sin(nx)n2
The parameter n is real and constant during integration; this antiderivative applies under the condition n ∈ ℝ \ {0}
For n = 0, the integrand is identically zero: the integral is 0
6) Let's evaluate for the interval [-π, π]: (sin(nπ)n2 -π·cos(nπ)n) -(sin(n·(-π))n2 -(-π·cos(n·(-π))n))
sin(nπ)n2 -π·cos(nπ)n -sin(n·(-π))n2 + -π·cos(n·(-π))n
sin(nπ)n2 -π·cos(nπ)n -sin(-nπ)n2 -π·cos(-nπ)n
ℹsin(-nπ) = -sin(nπ)‖cos(-nπ) = cos(nπ)
sin(nπ)n2 -π·cos(nπ)n -(-sin(nπ)n2) -π·cos(nπ)n
ℹ-(-sin(nπ)n2) = sin(nπ)n2‖-π·cos(nπ)n -π·cos(nπ)n = -2·π·cos(nπ)n
sin(nπ)n2 -2·π·cos(nπ)n + sin(nπ)n2
ℹ-2·π·cos(nπ)n = -2π·cos(nπ)n‖sin(nπ)n2 + sin(nπ)n2 = 2·sin(nπ)n2
2·sin(nπ)n2 -2π·cos(nπ)n
▶Integral:   2·sin(nπ)n2 -2π·cos(nπ)n