Solve Any Motion Physics Problem (Equations Supplied)
Maple, 41 chars

s:=i-&gt;solve({v=u+a*t,s=(u+v)*t/2,op(i)}):


(Formulas used: #1 and #3.  These are sufficient to let Maple derive the rest.)

This defines a function s that takes in a set of initial conditions and solves the equations of motion for those initial values.  For example, the command:

&gt; s({ u = 1, v = 2, t = 3 });


outputs:

                          {a = 1/3, s = 9/2, t = 3, u = 1, v = 2}




Notes:

You generally need to specify three initial values for a unique solution; if you don't provide enough, Maple will try to give you a partial solution:

&gt; s({ u = 1, v = 2 });

                                        3 t
                          {a = 1/t, s = ---, t = t, u = 1, v = 2}
                                         2


(Yes, that's an ASCII art fraction there.  Even in text mode, Maple tries to typeset your math nicely.)

No solution is return for overspecified or otherwise unsolvable inputs; for example, s({ u = 1, v = 2, t = 0 }); outputs nothing.

If multiple solutions exist, Maple will generally try to return all of them:

&gt; s({ u = 1, s = 0, a = -1 });

                          {a = -1, s = 0, t = 2, u = 1, v = -1},
                          {a = -1, s = 0, t = 0, u = 1, v = 1}


Sometimes, the output may contain RootOf() expressions, as in:

&gt; s({ u = 10, s = 1, a = -1 });
                                                         2
                {a = -1, s = 1, t = RootOf(2 - 20 _Z + _Z , label = _L3), u = 10,
                                               2
                 v = 10 - RootOf(2 - 20 _Z + _Z , label = _L3)}


As far as Maple's concerned, this is a perfectly good solution, but if you want to turn it into something readable for us mere humans, use allvalues():

&gt; allvalues(s({ u = 10, s = 1, a = -1 }));   
                                            1/2                 1/2
                {a = -1, s = 1, t = 10 - 7 2   , u = 10, v = 7 2   },
                                            1/2                  1/2
                {a = -1, s = 1, t = 10 + 7 2   , u = 10, v = -7 2   }


Alternatively, you can specify the initial conditions as floating-point values, e.g. u = 10.0, which will cause Maple to return purely numerical solutions instead:

&gt; s({ u = 10.0, s = 1, a = -1 });

                {a = -1., s = 1., t = 0.1005050634, u = 10., v = 9.899494937},
                {a = -1., s = 1., t = 19.89949494, u = 10., v = -9.899494937}


Finally, note that, since Maple is a computer algebra system, it allows you to specify arbitrary equations in the input.  For example, if we didn't care about the specific initial velocity, but only about the change in velocity, we could just specify e.g. v = u + 1 and get the partial solution:

&gt; s({ v = u + 1 });

                {a = 1/t, s = t v - 1/2 t, t = t, u = v - 1, v = v}


We can even extend the physics model if we want, as in:

&gt; s({ f = m * a, u = 0, f = 1, m = 10, t = 5 });

                {a = 1/10, f = 1, m = 10, s = 5/4, t = 5, u = 0, v = 1/2}