Here's a problem on Application of Integral calculus to find the work done in moving a particle. I was able to 'reach' the 'right answer'. But I'm totally confused and utterly dissatisfied with the way I did it. It was like I found the way to end up at given answer and not the other way round.
The Question:
A particle of mass $m$ starts from rest at time $t=0$ and is moved along the $x$-axis with constant acceleration $a$ from $x=0$ to $x=h$ against a variable force of magnitude $F(t)=t^2$. Find the work done.
The answer to this question is given as $$ \frac{4h\sqrt{3mh}}{3} $$
My work:
The way to reach the given answer is simple. Let
$$
\begin{aligned}
F(t)&=t^2 \\
&=ma \\
\implies a=\frac{t^2}{m}
\end{aligned}
$$
Integrating this from $0$ to $t$, we get the velocity as a function of $t$ and doing it again, we get displacement as a function of t. $$ v(t)=\frac{t^3}{3m} \\ x(t)=\frac{t^4}{12m} $$
Time at which the the particle is at $x=h$ would be $$ t_h=\sqrt[4]{12mh} $$ Work done on the particle is the change in its kinetic energy between $t=0$ and $t=t_h$ $$ \begin{aligned} W &= \frac{1}{2}m\big[v(t_h)\big]^2-\underbrace{\frac{1}{2}m\big[v(0)\big]^2}_{=0} \\ &= \frac{1}{2}m \left\{\frac{t_h^3}{3m}\right\}^2 \\ &= \frac{1}{2}m \left\{\frac{(\sqrt[4]{12mh})^3}{3m}\right\}^2 \\ &= \frac{4h\sqrt{3mh}}{3} \end{aligned} $$
My Confusions:
The first equation that I've used:
$$
a=\frac{t^2}{m}
$$
goes against the problem statement. In the problem, $a$ is constant. But here I've taken it as a function of time and consequently, variable (since mass is constant).
My line of thought goes like this: If the particle is moving at a constant acceleration $a$ against the force $F(t)=t^2$, then there must be another force, say $F_1$, which should also be variable with time, that is overwhelming $F(t)$ to make the particle move with that constant acceleration. Right? $$ ma=F_1-F(t)=ma_1-t^2 $$ where $a_1$ should be variable with time.
If we continue with this, then we won't end up with the answer that is given. I'm really, really confused. Can someone help?