# Equation for position of mass suspended by a spring on an incline

I'm interested an application of hooke's spring equations to solve for the position of an object with respect to time in the following scenario:

Where $T_2$ is a spring with coefficient $k$. I assume the incline is infinitely long to the right and am interested in the distance moved along a coordinate system rotated by $\theta$, i.e. $x(t)$ along the incline itself. This simplifies it by making it a one-dimensional problem, whose solution can be generalized.

Because I've been accosted in the past for asking homework questions, when in fact the question cam from my own mind, I will note on the onset that this diagram was borrowed from an unrelated problem in the textbook – which is why $T_2$ is drawn as a rope not a spring.

## What I have tried

I'm looking for $x(t)= d(t)+x_0$, the position with respect to time, where $d(t)$ is the displacement with respect to time. Setting distance at which the spring is at rest as the origin, we have $x(t)=d(t) \implies x=d$

From the diagram, the leftwards force of the spring is $F_s=kd$ and the rightwards force of gravity is $mg\sin(\theta)$.

Thus the net force: $$F_{net} = ma = kd-mg\sin(\theta)$$

Solving for $a$, we have: $$a=\left(\frac{k}{m}\right)d-g\sin(\theta)$$

My simple knowledge of physics led me first to using this equation (it didn't occur to me at the time that the situation is more nuanced that I thought, i.e. non constant acceleration): $$x-x_0 = v_0t+\frac{1}{2}at^2$$

Plugging in $a$, we can solve for d:

$$d = \frac{mg\sin(\theta)t^2}{1-kt^2}$$

and plug this back into the equation for $a$, yielding

$$a=\frac{gsin(\theta)}{kt^2-1}$$

Using a CAS to double integrate, as I'm just taking differential calculus now, we can get an equation for position. $$x(t)=d(t)+0=g \left(\frac{t \sqrt{\frac{1}{k}}}{2} \log{\left (t - \sqrt{\frac{1}{k}} \right )} - \frac{t \sqrt{\frac{1}{k}}}{2} \log{\left (t + \sqrt{\frac{1}{k}} \right )} - \frac{1}{2 k} \log{\left (t - \sqrt{\frac{1}{k}} \right )} - \frac{1}{2 k} \log{\left (t + \sqrt{\frac{1}{k}} \right )}\right) \sin{\left (O \right )}$$

## Why it is Wrong

I know my equation for position was derived assuming a constant acceleration – and here acceleration is not constant.

## What I am Looking For and Why Help is Necessary

After seeing the answers to this question I realize I'll need more involved calculus to solve my question of interest. However, knowing only the rudimentary rules of integration without having a solid theoretical basis precludes me from solving more involved integrals, such as the circular integral with acceleration and position we have here. I'm looking for a step by step derivation of an $x(t)$ equation. Thanks so much.

## Edit

From the comments I learned I am dealing with a differential equation of the form

$$x''(t)=\frac{k}{m}x(t)-g\sin(\theta)$$

Which I solved with wolfram alpha, yielding:

$$x\left(t\right)=e^{\left(\frac{\sqrt{k}t}{\sqrt{\left(m\right)}}\right)}+e^{\left(-\frac{\sqrt{k}t}{m}\right)}+\frac{gm\sin \left(\theta _1\right)}{k}$$

This seems to be correct, but I need confirmation.

• You result is incorrect because the signs are wrong. Try DSolve with $m\ddot{x}+kx-mg\sin \theta=0$ (or divided by $m$). wolframalpha.com/input/?i=DSolve+%5Bmx%27%27(t)%2Bkx(t)-mgsin(a)%3D0%5D (where $a=\theta$)
– Gert
Oct 21 '16 at 0:17
• There is no nuance here, only an extra constant in $\ddot x+\omega^2 x=g\sin\theta$. The general solution is $x=CF+PI$ where $CF=A\sin(\omega t)+B\cos(\omega t)$. By inspection $PI=(1/\omega^2)g\sin\theta$. Oct 21 '16 at 21:59

You can't really solve this by simple integration because the equation of motion is a 2nd order differential equation.

Imagine an $x$-axis parallel to the incline and pointing right (and somewhat down).

The Newtonian equation of motion is now:

$$ma=-kx+mg\sin \theta \tag{1}$$

Where $\theta$ is the angle between horizontal and incline. With $a=\frac{d^2x}{dt^2}=\ddot{x}$, $(1)$ becomes:

$$m\ddot{x}+kx-mg\sin \theta=0\tag{2}$$

$(2)$ would be a simple 2nd order differential equation for which standard solutions exist, if it wasn't for that niggling $mg\sin \theta$ tail, so first we get rid of that with a little trick.

Divide both sides by $m$ and define:

$$\omega^2=\frac{k}{m}$$

This gives:

$$\ddot{x}+\omega^2x-g\sin \theta=0\tag{3}$$

Now substitute:

$$u=\omega^2x-g\sin \theta\tag{4}$$ $$\implies \dot{u}=\omega^2\dot{x}$$ $$\implies \ddot{u}=\omega^2\ddot{x}\implies \ddot{x}=\frac{1}{\omega^2}\ddot{u}$$ Into $(3)$ we get: $$\frac{1}{\omega^2}\ddot{u}+u=0$$ Multiply both sides by $\omega^2$ to get: $$\ddot{u}+\omega^2u=0\tag{5}$$ $(4)$ is the classic 2nd order linear homogeneous (ordinary) differential equation and it has the general solution:

$$u(t)=c_1\cos \omega t+ c_2\sin \omega t$$

To determine the integration constants $c_1,c_2$ we need initial conditions:

$x(0)=x_0$, which is the displacement at $t=0$. We also assume that at $t=0$, $v=\dot{x}=0$. Use $(4)$ to define $u(0)$, then $\dot{u}(0)$ and use these expressions to work out $c_1$ and $c_2$.

This gives you a full expression for $u(t)$ and with $(4)$:

$$u(t)=\omega^2x(t)-g\sin \theta$$

Extract $x(t)$ from there, for a full description of displacement in time. It's the kinematic equation of a simple harmonic oscillator with angular velocity $\omega=\sqrt{\frac{k}{m}}$.

Alternative substitution to $(3)$ (starting from $(2)$):

$$u= kx-mg\sin \theta$$

This also works and leads to the same end result.

• I have merely conceptual exposure to differential equations – so with your $u(t)$, how do I get an equation for distance? Your answer is excellently done besides for this point. Thank you so much. Oct 20 '16 at 23:40
• Edit being made right now. 1 minute.
– Gert
Oct 20 '16 at 23:42
• Sorry - I still am missing something. In your final equation, what do I replace $u$ and $w$ with? Oct 20 '16 at 23:54
• $u(t)=\omega^2x(t)-g\sin \theta$ with $\omega=\sqrt{\frac{k}{m}}$.
– Gert
Oct 21 '16 at 0:00
• Ok – I'm sorry I dont get how to write an expression for $x(t)$? I can substitute for $\omega$ but how to get rid of $u(t)$ I do not know. Using eq (4) I just get 1=1. Oct 21 '16 at 0:34

This is more of a hint than a complete answer since I believe you only made a small mistake.

Be careful how you integrate, here g, k and tetha are all constants, you do not need to integrate them.

Furthermore, don't use predefined kinematics equations, use dv/dt=ma and F=mg. Find the net force on the object, then the net acceleration, and integrate dt twice.

Edit: I've looked at your profile and saw that you have a great interest in physics, if learning all the maths behind it is not a priority, I would recommend the book "Classical Mechanics" by John r. Taylor.

You only need to know basic high-school mathematics to get started, the book will teach you the necessary mathematical theories as you go further.

It's used across many universities and available everywhere, and i'm sure your local library has it. There's free previews on:

http://www.qom.ac.ir/portal/File/ShowFile.aspx?ID=e42aab20-f427-4881-a3dd-f4078631c6fe

https://www.scribd.com/doc/46234388/John-Taylor-Classical-Mechanics

The book will give it's readers a good and robust base on classical mechanics. It covers kinematics, force, energy, all the way until special relativity.

• So you are saying every step is correct until the integration? Oct 20 '16 at 22:55
• You just have to integrate the net acceleration twice. So you don't need to do step 3-6. a=(k/m)d-gsin(tetha) should be correct. Oct 20 '16 at 22:58
• here a is d^2x/dt^2, and d is x so you will have to solve a second order differentiation equation. Oct 20 '16 at 23:00
• So this is a differential equation? Oct 20 '16 at 23:02
• It won't take long to get those.
– Gert
Oct 21 '16 at 0:29