Can we explain Newton's first law mathematically? At constant speed there is no acceleration. $(f'(x)=v'=0=a)$ .If $a=0$ then $F=ma=0$ and therefore no force acts on the object so the object will continue in the same direction, if any. This is only realistic in zero gravity(?)
Is the above explanation satisfactory? The other answers are less mathematical. So I wonder if we can explain the first law using the above "math". 
 A: Damon writes:

Essentially, the second law is the mathematical formulation of the
  first one, f=ma, f being the unbalanced force acting upon the other
  body.

Actually is the other way round: the first law is a particular case of the second law, where F = 0. If no force is acting on a body its velocity does not change 
$F = 0 \rightarrow a = 0$
Note: to be precise what is usually referred to as second law of Newton is actually first law of Euler
A: Further to Damon Blevins's pithy answer, you need to be stating what an inertial frame is, so that you can measure your acceleration. A practical answer: you carry with you an accelerometer, and if this measures "nought" then Damon's formulation is good and Newton's first law is that in the absence of any nett force on it, a body will be either comoving with you or moving at a constant relative velocity to you.
If you simply have a general system of co-ordinates wherein you have found a metric $g$ fulfilling the Einstein field equations of General Relativity describing the distribution of mass in the universe around you, then Newton's first law is that, in the absence of any nett force on it, any body must follow a geodesic line defined by:
$${d^2 x^\mu \over ds^2} + \Gamma^\mu {}_{\alpha \beta}{d x^\alpha \over ds}{d x^\beta \over ds}=0$$
where $s$ is any suitable parameter parameterising the body's path (often the proper time) and $\Gamma$ is the connexion co-efficient (Christoffel symbol) derived in the standard way from the metric $g$:
$$\Gamma^\mu{}_{\alpha\,\beta}= {1 \over 2} g^{\mu \,\nu} (g_{\nu\,\alpha,\beta} + g_{\nu\,\beta,\alpha} - g_{\alpha\,\beta,\,\nu})$$
Given the geodesic equation is second order, any such line is uniquely defined by the body's spacetime position and four velocity relative to the co-ordinate system at $t=0$.
Essentially these equations define the motion of a point mass that, as you say, experiences zero gravity.
A: The first law is really just the statement that intertial frames exist.
A: Essentially, the second law is the mathematical formulation of the first one, $F=ma,$ $F$ being the unbalanced force acting upon the other body.
A: You write "At constant speed there is no acceleration. (f'(x)=v'=0=a) .If a=0 then F=ma=0 and therefore no force acts on the object so the object will continue in the same direction, if any", which sounds like:
If the velocity is constant then the acceleration is zero, and then the net force is zero (which uses the second law and is the opposite of Newton's first law, but is all correct so far) but then you go on and say that the object continues at constant velocity.  But that was your assumption, so it's strange to have it be your conclusion too.  Now if you meant for Newton's first law to appear where you say "no [net] force acts on the object so the object will continue in the same direction", that is the gist of the first law.  But it's not an explanation.
The first law is a supplement to the second law.  The second law says that $F=ma$, but unfortunately $F=ma$ doesn't tell us whether objects at rest subject to zero net force remain at rest or start to move (see Nonuniqueness in the solutions of Newton’s equation of motion by Abhishek Dhar Am. J. Phys. 61, 58 (1993); http://dx.doi.org/10.1119/1.17411 to see solutions to F=ma that violate Newton's first law).
Edit: Edited to answer the questions.
To answer your title question, the first law cannot be derived from Newton's other laws, so it cannot be explained in that sense.  If you want a mathematical explication of the first law you can write:
Given a force law $F=F(x,v,t)$ and any of the many possible solutions $x=x(t)$ such that $F(x(t),v(t),t)=m a(t)$ holds for all $t$ then a body's own inclination to stay at constant velocity selects some solutions $x=x(t)$ in favor of other solutions.  Specifically any solution (i.e. $x=x(t)$ such that $F(x(t),v(t),t)=m a(t)$ holds for all $t$) that has $x(t)=x(t_0)+(t-t_0)v(t_0)$ hold for $t$ in some interval $[t_0,t_1]$ (where $t_1 > t_0$, and $F(x(t_0),v(t_0),t_0)=0$) is selected over other solutions (other $x=x(t)$ such that $F(x(t),v(t),t)=m a(t)$ holds for all $t$).
I.e. When there is no net force, the body's own inertia insists that the velocity remain constant, not merely that the acceleration be zero as F=ma would require.
We can see the first law in effect by looking at an example where it comes into play.  The function $x(t)=0$ and the function $x(t)=(Kt)^3$ both have an acceleration of zero at $t=0$, only in the former is the velocity constant. So $x(t)=0$ has that whole interval of $t$ where the velocity is uniform, whereas $x(t)=(Kt)^3$ does not.  If they are both solutions to $F=ma$, then $F=ma$ likes both, but the first law says that the body's own tendency for uniform motion selects the former over the latter.  Note that the functions $x(t)$ both have $x(0)=0$, $v(0)=0$, $a(0)=0$ but only the solution $x(0)=0$ remains at constant velocity, because a constant velocity is much stronger than merely changing the velocity slowly enough that $a=0$.  The first law selects that uniform motion solution out of the many that the second law allowed.  
Now let's see that first law in action.  Consider a scalar potential $V=-Cx^{(4/3)}$, then $F=ma$ selects as solutions functions of time $x=x(t)$ such that $ma=F(x)=(4/3)Cx^{(1/3)}$.  What are some solutions?  The function $x(t)=0$ is a solution because $F(x)=(4/3)Cx^{(1/3)}=0=m0=ma$.  What about functions like $x(t)=(Kt)^3$?  They have $a(t)=K^36t$ and $x^{(1/3)}=Kt$, so we need $m(K^36t)=ma=F=(4/3)Cx^{(1/3)}=(4/3)CKt$, which holds when $K^2=\frac{2C}{9m}$.  So the potential $-Cx^{(4/3)}$ gives a force law that has a solution where $x(t)=0$ and another solution where $x(t)=(2C/9m)^{(3/2)}t^3$.  They both have $x(0)=0$, they both have $v(0)=0$, they both satisfy $F=ma$.  So they are both predicted by the second law if we don't have the first law.  But the first law notes that the first one, $x(t)=0$ remains at constant velocity when no net force acts.  Newton's first law says this is because the body has its own tendency to select that solution.  It supplements the second law, because the second law doesn't say that the body has to remain at constant velocity only that it change the velocity so slowly that $a=0$ when the force is zero. The solution $x(t)=(Kt)^3$ is example where the velocity is never constant.  Instead, the velocity merely changes slowly enough at $t=0$ to allow $a(0)=0$ where the net external force is zero.
The first law is very very powerful, it tells you that when you see a body change its uniform motion you should look for an external force, and it tells you that when its motion remains uniform that you do not need to look for external forces, that it can do that by itself.  Newton even considered rotations as a uniform motion.  It's all about external forces versus the body's own forces.  For instance, when a body spins it becomes oblate (expands around the parts that move at higher tangential speed) because that it what generates the internal forces that enforce that uniform rotation.  Newton would note that the earth is oblate all around the middle, not because of an external force (the tides from the moon would be an example of an external force, and those are not constant).  The earth is oblate all around the middle so that the body of the earth can exert it's own self force to keep itself in uniform rotation.  All three laws work together and do something, together with his system of the world.
That address the title question.  
As for the next question, whether the first law only applies in zero gravity.  You can use it any time there is no net external force, it's just that when there is no net external force, $F=ma$ allows non uniform motion.  The first laws says the body has its own tendency towards uniform motion.  That tendency is overridden by a net external force, so in those situations, use $F=ma$.
That addresses the second question.
As for your last question about whether what you wrote explains the first law mathematically, that's what I addressed at the beginning of the post. Your statements assume uniform motion, then conclude there is uniform motion, so your statements explain absolutely nothing.  The second law already tells us that when there is no net force then you have to change your velocity slowly enough to get $a=0$ (e.g. $x(t)=0$, or $x(t)=x(0)+v(0)t$ or even $x(t)=x(0)+v(0)t+(Kt)^3$, all three of which change their resepctive velocities slowly enough at $t=0$ to have $a(0)=0$). The first law tells you that when the net force is zero, there is an additional tendency of the body to maintain its uniform motion, and that this kicks in and makes it actually maintain uniform motion when there are no net external forces acting.
Newton's first law is about a newly (not ancient greek) hypothesized tendency of bodies to remain in uniform motion.  It contradicted ancient greek traditions.  The first two laws together give us more information than the second law by itself.  So you can use the first law to supplement what the second law tells you.  Each law can be used to do something.
You can make laws of mass and force.  The the third law of motion says to reject those laws of force that don't conserve momentum.  The second law says that you can observe displacement histories $x(t)$, and from them compute acceleration histories $a(t)$ and use them to compare $x(t)$ to the solutions of $ma(t)=F(x(t),v(t),t)$, and thus reject force laws.  The first law says that you can reject certain solutions to $F=ma$, which is great since it gives too many solutions anyway.
The first law is 100% about restricting the solutions to the second law, and so serves as a supplement.  It also says why, and that it is the natural tendency of a body to remain in uniform motion that makes it remain in uniform motion when subjected to no net external force.
A: $\sum \mathbf{F} = 0\; \Leftrightarrow\; \frac{\mathrm{d} \mathbf{v} }{\mathrm{d}t} = 0.$
Is that good enough?
A: Its already answered, but I'll add some more points.  
To formulate the First law mathematically, we need to first formulate the Second law.

Newton's Second law :
  The force causing acceleration is proportional to the rate of change of momentum with time and acts in the direction of the change.

$$\begin{align}
F\ &\propto\ \frac{mv-mu}{t}\\
F\ &\propto\ \frac{m(v-u)}{t}\\
F\ &=\ kma\\
\end{align}$$
Now, $k$, by definition of $1\ \text{Newton}$, is $1$ $(1\ N = 1\ ms^{-2})$.
$\therefore\ F=ma$
Now if $F=0$, Either $a$ or $m$ or both need to be zero. We know $m$ is non-zero, therefore $a=0$. This means 
$$\begin{align}
a\ =&\ \frac{v-u}{t}\\
0\ =&\ \frac{v-u}{t}\\
\implies u\ =&\ v\\
\end{align}$$
Or, when $F=0$, initial velocity is equal to final velocity, or, there is no change in the velocity, of the body, which is what Newton's First Law states.

Newton's First Law:
  An object at rest stays at rest and an object in motion stays in motion with the same speed and in the same direction unless acted upon by an unbalanced force.

