# I Numerical Integration twice (acceleration to displacement)

#### Pcmath

Hello everyone

I have the following question regarding numerical integration twice from acceleration to displacement.

Suppose that a particle has acceleration function of a = tt (which has non-elementary integral), to find the velocity it is easy as I can use Simpson's rule for numerical integration. But now I would like to find the displacement of the particle after some time, let say 5 seconds, how do I calculate it?

Note that I need very accurate answer, so I usually integrate numerically using Excel with thousand interval.

I prefer to use Newton-Cotes formula if possible.

EDIT
I tried using integration by parts, but I always reach a point where I can't continue.
a = tt
Let v = ∫ tt
s = ∫ v
= t*v - ∫ t*tt
= t ∫ tt - ∫ t*tt

For example, to find the displacement after t = 5 seconds
∫ t*tt from 0 to 5 is easy to integrate numerically
But the problem is t ∫ tt I don't know how to do it because there is variable outside the integral.

For those who don't know, I am using integration by parts formula for definite integral, it includes find the value of
( t ∫ tt ) from 0 to 5

Last edited:

#### BvU

Homework Helper
Hello pcmath, : welcome:

You have $\ a = t^t\$ and with $\ a = \displaystyle {dv\over dt} \$ you get $\ v = \int a\;dt\ = \int t^t\; dt$.

Then , with $\ v= \displaystyle {ds\over dt} \$ you can write $\ s = \int \left (\ \int t^t\; dt\ \right ) dt'$. Written with bounds:$$s(t) = \int_{t'= 0}^t \left (\ \int_{t''=0}^{t' } t''^{(t'')} \; dt''\ \right ) dt'$$
That is your double integral.
s = ∫ v = t*v - ∫ t*tt = t ∫ tt - ∫ t*tt
is something I cannot agree with.

You could do a double numerical integration using forward Euler
$$v(t+\Delta t) = v(t) + a(t) * \Delta t \\ s(t+\Delta t) = s(t) + v(t) * \Delta t \$$ and you would indeed have to take very small steps because a(t) is so steep.

Last edited:

#### mfb

Mentor
If you just need this once do it with tiny integration steps (or check WolframAlpha). If you need it many times, it is worth implementing a better integration scheme - Verlet integration or one of the other methods discussed there.

#### Pcmath

Thank you guys for your help, I will try it.

is something I cannot agree with.
This is actually correct as I have tried it. Assuming that a = x^2 then you can find s using that way, it gives the same value as integrate twice.

#### BvU

Homework Helper
This is actually correct as I have tried it
Note that one successful example does not a proof constitute. It looks like integration by parts and then the question is: what is the time derivative of $t^t$

#### nathal

Hello everyone

I have the following question regarding numerical integration twice from acceleration to displacement.

Suppose that a particle has acceleration function of a = tt (which has non-elementary integral), to find the velocity it is easy as I can use Simpson's rule for numerical integration. But now I would like to find the displacement of the particle after some time, let say 5 seconds, how do I calculate it?

Note that I need very accurate answer, so I usually integrate numerically using Excel with thousand interval.

I prefer to use Newton-Cotes formula if possible.

EDIT
I tried using integration by parts, but I always reach a point where I can't continue.
a = tt
Let v = ∫ tt
s = ∫ v
= t*v - ∫ t*tt
= t ∫ tt - ∫ t*tt

For example, to find the displacement after t = 5 seconds
∫ t*tt from 0 to 5 is easy to integrate numerically
But the problem is t ∫ tt I don't know how to do it because there is variable outside the integral.

For those who don't know, I am using integration by parts formula for definite integral, it includes find the value of
( t ∫ tt ) from 0 to 5
Hallo

You can use precise cubatures of Gauss type according: "Computation of definite integral over repeated integral" Tatra mountains, publ. 75 (2018). The Newton-Cotes is in preparation now. Shortly, for order 5 you can use standard quadrature newton-Cotes: v5= v0+5h/288(19a0+75a1+50a2+50a3+75a4+19a5)
and cubature for displacement: s5=s0+v0*(5*h)+25h*h/2016(122a0+475a1+100a2+250a3+50a4+11a5)
The polynomial precision is 5.

### Want to reply to this thread?

"Numerical Integration twice (acceleration to displacement)"

### Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving