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.