Problem 
At what angle should you throw a projectile - subject to uniform gravity
and ignoring air resistance - in order to maximize the length of its
trajectory?
Solution 
Without any loss of generality we can assume the velocity to be 1 1 1 θ \theta θ 
x = cos  θ t y = sin  θ t − 1 2 g t 2 \begin{aligned}
x & = \cos\theta t \\\\
y & = \sin\theta t - \frac{1}{2}gt^{2}
\end{aligned} x y  = cos θt = sin θt − 2 1  g t 2  The length of the trajectory is given by,
L ( t ) = ∫ 0 t x ˙ 2 + y ˙ 2 d t L(t) = \int_{0}^{t}\sqrt{{\dot{x}}^{2} + {\dot{y}}^{2}}dt  L ( t ) = ∫ 0 t  x ˙ 2 + y ˙  2  d t When the projectile touches the ground again,
t = 2 sin  θ g . t = \frac{2\sin\theta}{g}. t = g 2 s i n θ  . 
Therefore, we need to maximize,
L ( θ ) = ∫ 0 2 sin  θ g ( cos  θ ) 2 + ( sin  θ − g t ) 2 d t = ∫ 0 2 sin  θ g 1 − 2 sin  θ g t + g 2 t 2 d t = 1 g ∫ 0 2 sin  θ 1 − 2 sin  θ t + t 2 d t = 1 2 g [ sin  θ + cos  2 θ log  ( 1 + sin  θ ) ] − 1 2 g [ − sin  θ + cos  2 θ log  ( 1 − sin  θ ) ] = 1 2 g [ 2 sin  θ + cos  2 θ log  ( 1 + sin  θ 1 − sin  θ ) ] . \begin{aligned}
L(\theta) &= \int_{0}^{\frac{2\sin\theta}{g}}\sqrt{\left( \cos\theta \right)^{2} + \left( \sin\theta - gt \right)^{2}}dt \\
 &= \int_{0}^{\frac{2\sin\theta}{g}}\sqrt{1 - 2\sin\theta gt + g^{2}t^{2}}dt \\
 &= \frac{1}{g}\int_{0}^{2\sin\theta}\sqrt{1 - 2\sin\theta t + t^{2}}dt \\
 &= \frac{1}{2g}\left\lbrack \sin\theta + \cos^{2}\theta\log(1 + \sin\theta) \right\rbrack - \\  &\frac{1}{2g}\left\lbrack - \sin\theta + \cos^{2}\theta\log(1 - \sin\theta) \right\rbrack \\
 &= \frac{1}{2g}\left\lbrack 2\sin\theta + \cos^{2}\theta\log(\frac{1 + \sin\theta}{1 - \sin\theta}) \right\rbrack.
\end{aligned} L ( θ )  = ∫ 0 g 2 s i n θ   ( cos θ ) 2 + ( sin θ − g t ) 2  d t = ∫ 0 g 2 s i n θ   1 − 2 sin θ g t + g 2 t 2  d t = g 1  ∫ 0 2 s i n θ  1 − 2 sin θt + t 2  d t = 2 g 1  [ sin θ + cos 2 θ log  ( 1 + sin θ ) ] − 2 g 1  [ − sin θ + cos 2 θ log  ( 1 − sin θ ) ] = 2 g 1  [ 2 sin θ + cos 2 θ log  ( 1 − sin θ 1 + sin θ  ) ] .  Here, we have made use of the following:
∫ a x 2 + b x + c d x = ( 2 a x + b ) x ( a x + b ) + c 4 a − ( ( b 2 − 4 a c ) log  ( 2 a x ( a x + b ) + c + 2 a x + b ) ) 8 a 3 2 \begin{aligned}
&\int\sqrt{ax^{2} + bx + c}dx \\ &= \frac{(2ax + b)\sqrt{x(ax + b) + c}}{4a} - \\ &\frac{\left( \left( b^{2} - 4ac \right)\log(2\sqrt{a}\sqrt{x(ax + b) + c} + 2ax + b) \right)}{8a^{\frac{3}{2}}}
\end{aligned}  ∫ a x 2 + b x + c  d x = 4 a ( 2 a x + b ) x ( a x + b ) + c   − 8 a 2 3  ( ( b 2 − 4 a c ) log  ( 2 a  x ( a x + b ) + c  + 2 a x + b ) )   Differentiating L ( θ ) L(\theta) L ( θ ) θ \theta θ 
2 cos  θ + 2 cos  θ − 2 sin  θ cos  θ log  ( 1 + sin  θ 1 + sin  θ ) = 0 ⇒ 2 csc  θ = log  ( 1 + sin  θ 1 − sin  θ ) . \begin{aligned}
& 2\cos\theta + 2\cos\theta - \\ & 2\sin\theta\cos\theta\log\left( \frac{1 + \sin\theta}{1 + \sin\theta} \right) = 0 \\
& \Rightarrow 2\csc\theta = \log(\frac{1 + \sin\theta}{1 - \sin\theta}).
\end{aligned}  2 cos θ + 2 cos θ − 2 sin θ cos θ log  ( 1 + sin θ 1 + sin θ  ) = 0 ⇒ 2 csc θ = log  ( 1 − sin θ 1 + sin θ  ) .  Solving the above equation numerically, we get θ = 0.9855 \theta = 0.9855 θ = 0.9855 = 56.46 5 ∘ . = \mathbf{56.465^{{^\circ}}}. = 56.46 5 ∘ .