# Differentiation under integral sign

#### Dhamnekar Winod

##### Active member
Hello,

How to find formulas for these$\displaystyle\int x^n\sin(x)\, dx, \displaystyle\int x^n\cos(x)\, dx,$ indefinite integrals when $n=1,2,3,4$ using differentiation under the integral sign starting with the formulas

$$\displaystyle\int \cos(tx)\,dx = \frac{\sin(tx)}{t}, \displaystyle\int \sin(tx)\,dx= -\frac{\cos(tx)}{t}$$ for $t > 0.$

I don't have any idea to solve these indefinite integrals except to solve them recursively using integration by parts.

#### HallsofIvy

##### Well-known member
MHB Math Helper
You are required to use "differentiation" under the integral? These can be done directly using "integration by parts".

#### MountEvariste

##### Well-known member
See what happens when you differentiate both sides of those relations with respect to $t$ and then set $t=1$.

#### Dhamnekar Winod

##### Active member
See what happens when you differentiate both sides of those relations with respect to $t$ and then set $t=1$.
Hello,
I solved the two indefinate integrals using differentiation under integral sign as well as using integration by parts. Under these both method i got the correct answers. For example if we put n=4,the integral to be solved becomes $\displaystyle\int x^4\sin{(tx)}dx =\frac{(4x^3t^3-24tx)*\sin{(tx)}+(-x^4t^4+12x^2t^2-24)*\cos{(tx)}}{t^5}$

Now if we put t=1, the answer will become $(4x^3-24x)*\sin{(x)}+(-x^4+12x^2-24)*\cos{(x)}$

Now how to derive the formula for $\displaystyle\int x^4\sin{(x)}dx?$

In other cases where n=1,2,3, similar problem will persist.

#### MountEvariste

##### Well-known member
In other cases where n=1,2,3, similar problem will persist.
Perhaps you've figured it out by now, but I don't see any differentiation under integral sign.

$$\displaystyle\int \cos(tx)\,dx = \frac{\sin(tx)}{t}, \displaystyle\int \sin(tx)\,dx= -\frac{\cos(tx)}{t}$$ for $t > 0.$
In these two equalities, differentiate both the RHS and the LHS with respect to $t$. Adjust for constant. Do it again, and again. You'll get all of them.