Twins paradox "corrected" If you know a bit of special relativity, probably you've heard of the twin paradox. I would like to know: what happens if we take acceleration into account in the paradox. Usually we consider an instantaneous change of velocity for the moving twin (before he was moving at, say, $\frac{c}{2}$, when coming back, he's suddenly moving at $-\frac{c}{2}$...)
My work on the problem:
Let Alice (the first twin) be still in an IS (coordinates $t,x,y,z$), and Bob (they're heterozygotes, obviously!) be moving. The coordinates system KS' of Bob ($t',x',y',z'$) is not inertial and satisfies:
$$\left\{\begin{array}{l}t=t'\\x=x'+\sin(t')\\y=y'\\z=z'\end{array}\right.$$
so that Bob (located at the origin of KS') moves away from Alice for $0\le t\le\frac{\pi}{2}$, and comes back for $\frac{\pi}{2}\le t\le\pi$. We have:
$$\begin{array}{l}dt = dt'\\dx = \cos(t')dt'+dx'\\dy=dy'\\dz=dz'\end{array}$$
and thus:
$$\begin{array}{ll}ds^2 & = dt^2-dx^2-dy^2-dz^2 =\\ & =(1-\cos^2(t'))dt'^2-2\cos(t')dt'dx'-dx'^2-dy'^2-dz'^2\end{array}$$
By fixing a clock at constant $x',y',z'$ in KS' and looking at the proper time, we get:
$$d\tau = \sqrt{1-\cos^2(t')}dt' = \sqrt{1-\cos^2(t)}dt = \sin(t)dt$$
(where we used $t=t'$ and $dt=dt'$). Integrating from $t=0$ to $t=\pi$ (the time Bob takes to go away and come back) we get the time a clock in KS' will mark when Bob is back home (where the clock marked $0$ when he went away):
$$\int_0^\pi\sin(t)dt = 2$$
which looks weird... (Note: I expected this to give $\pi$, so that there would have been no paradox at all.) Can someone spot eventual mistakes I made?
Note: I followed the same procedure I found in these lecture notes at pages 18-19.
 A: No, unless I am mistaken your calculations are right. When Bob gets back to Alice, his clock really has counted a shorter proper time lapse - he has indeed aged less - and this is exactly what you would expect. 
There is no "paradox" in the sense of a contradiction. Bob is in an accelerated frame of reference, so he cannot validly do the analogous calculation for Alice. Your calculation method only holds for an inertial frame. 
Imagine the thought experiment done with both observers taking a system of accelerometers with them so that they can be aware of whenever their frame is not inertial. Acceleration defined in this way in relativity, general or special, is absolute (it defines the geometry, and its deviation from Euclid, so it is a "shape of a fabric"), so you may need to ponder that carefully: Einstein nowadays seems to be held up in Arts and Letters Faculties as a pseudo-justification that everything is relative, so this erroneous idea has become part of our culture. You can also think of the problem from the standpoint of the twin who decelerates but this is much more complicated and the calculation is also sketched for you on the Twin Paradox Wiki page. In the wonted calculation, where Bob goes off at constant speed, wends around and comes back, his reckoning of the inertial twin's time is dilated as he coasts away and coasts back, but there is a "catchup" wrought in their frame by the acceleration phase, so that the nett effect is the same as calculated from the inertial frame.
