# How to integrate by using "Integration by parts"?

A simple harmonic oscillator whose Action is given by:

$$S=\displaystyle\int dt\left(\frac{1}{2}\cdot m\left(\frac{dx}{dt}\right)^2-\frac{1}{2}m\omega x^2\right)$$

here x is a function of time i.e $$x(t)$$ . Use the above equation and by doing integration by parts show that : $$S=\displaystyle\int dt\left(-\frac{1}{2}\cdot m\cdot x\left(\frac{d^2x}{dt^2}\right)-\frac{1}{2}m\omega x^2\right)$$ (here the upper limit is $$t_1 = x_1$$ and lower limit is $$t_2 = x_2$$)

I know what integration by parts is which is by defining a $$u$$ and $$v$$ functions according to simplicity then integrate according to it. Here I have to calculate everything with respect to Time how will I handle variable here which doesn't depends on time will I take them as constant ? and how did the second part$$\left(-\frac{1}{2}m\omega x^2\right)$$ remained the same? Please help me with the procedure.

My solution from @Y Tong hint ,

$$=\int \frac{1}{2}\cdot m \frac{dx}{dt} dx-\int \frac {1}{2}m\omega x^2 dt$$

taking , $$\frac{1}{2}m \frac{dx}{dt}=u$$ and $$dx=v$$

$$=\int\frac{1}{2}m \frac{dx}{dt} x \biggr\rvert_{\mathbf{t_1}}-\int \frac{1}{2}m \frac{d}{dt}(\frac{dx}{dt})x$$

Eventually I got ,

$$=-\int \frac{1}{2}m \frac{d}{dt}(\frac{dx}{dt}) x -\int \frac{1}{2} m \omega x^2 dt$$

And I am stuck here to generalize it into proven part . Can anyone help with the next steps ?

• Yes, everything except $x$ is to be treated as a constant. Dec 25 '20 at 17:51
• @Tavish can you tell me what does that t1=x1 mean in the limit part ? Dec 25 '20 at 18:59
• I’m not sure, but it could mean the upper limit of the integral, i.e. the integral is from $x_2$ to $x_1$. Dec 25 '20 at 19:29
• The stated upper limits don't make sense given the context. I would instead expect $x_1=x(t_1)$ and $x_2=x(t_2)$, i.e., $x_1,x_2$ are the initial and final positions. Dec 25 '20 at 19:33
• @Tavish i really have no idea how to use Integration by parts here! If i use integration by parts here, from (1/2 m x'') i should get two expression ... Dec 25 '20 at 19:46

You want to use $$\int udv=uv|_{t_1}^{t_2}-\int v du$$ which is due to $$(uv)'=u'v+uv'$$.
Take $$u=\frac12 m\frac{dx}{dt}$$ and $$dv=dx$$, you have $$\int_{t_1}^{t_2}\frac12 m\frac{dx}{dt} dx=\frac12 m\frac{dx}{dt} x|_{t_1}^{t_2}-\int_{t_1}^{t_2} \frac12 mx \frac{d^2x}{dt^2}dt.$$ The variation should be there but for typical applications of the least action principle, you will fix the ends, so it doesn't matter. However, the potential term should have been $$\frac12m\omega^2 x^2$$ instead of $$\frac12 m\omega x^2,$$ or you won't even have matching units.
• Oh, I see what you were wondering about. I made a typo in my $vdu$ part. $v$ is just x$, and$du=\frac12 m \frac{d^2 x}{dt^2} dt\$. So the integration by part was already complete. Dec 26 '20 at 18:41