# Where's my Error?

1. Aug 16, 2005

### bomba923

With no air resistance, I shoot a cannonball from a building of height $h$, with an initial velocity $v_0$ at an angle of elevation $\theta$. I'm trying to find the optimal angle for maximum range. I will use a parametric equation to represent the cannonball location at the time $t$. So,
*The cannonball's position is represented by the parametric function (well, obviously the initial position is at $\left( {0,h} \right)$),
$$\left\{ \begin{gathered} x = v_0 t\cos \theta \hfill \\ y = h + v_0 t\sin \theta - \frac{{gt^2 }}{2} \hfill \\ \end{gathered} \right\}$$
and so time it takes for the cannonball to hit the ground is
$$h + v_0 t\sin \theta - \frac{{gt^2 }}{2} = 0 \Rightarrow t = \frac{{ - v_0 \sin \theta + \sqrt {v_0^2 \sin ^2 \theta - 2gh} }}{{2h}}$$
*Thus, the range of the projectile is
$$x = v_0 \cos \theta \frac{{\sqrt {v_0^2 \sin ^2 \theta - 2gh} - v_0 \sin \theta }}{{2h}} = \frac{{v_0 \cos \theta }}{{2h}}\left( {\sqrt {v_0^2 \sin ^2 \theta - 2gh} - v_0 \sin \theta } \right)$$
**But, which $$\theta$$ will maximize the range?
$$\frac{{d}}{{d\theta }}\left[ {\frac{{v_0 \cos \theta }}{{2h}}\left( {\sqrt {v_0^2 \sin ^2 \theta - 2gh} - v_0 \sin \theta } \right)} \right] = 0 \Rightarrow$$
$$\frac{1}{{2h}} \cdot \left[ {v_0 \cos \theta \left( {\frac{{2v_0^2 \sin \theta \cos \theta }}{{2\sqrt {v_0^2 \sin ^2 \theta - 2gh} }} - v_0 \cos \theta } \right) - v_0 \sin \theta \left( {\sqrt {v_0^2 \sin ^2 \theta - 2gh} - v_0 \sin \theta } \right)} \right] = 0 \Rightarrow$$
*Well, I can factor out $v_0 /2h$, and set what remains equal to zero:
$${v_0 \cos ^2 \theta \left( {\frac{{v_0 \sin \theta }}{{\sqrt {v_0^2 \sin ^2 \theta - 2gh} }} - 1} \right) - \sin \theta \left( {\sqrt {v_0^2 \sin ^2 \theta - 2gh} - v_0 \sin \theta } \right)} = 0 \Rightarrow$$
$$\frac{{v_0^2 \sin \theta \cos ^2 \theta }}{{\sqrt {v_0^2 \sin ^2 \theta - 2gh} }} - v_0 \cos ^2 \theta + v_0 \sin ^2 \theta - \sin \theta \sqrt {v_0^2 \sin ^2 \theta - 2gh} = 0 \Rightarrow$$
$$v_0 \left( {\frac{{v_0 \sin \theta \cos ^2 \theta }}{{\sqrt {v_0^2 \sin ^2 \theta - 2gh} }} - \cos 2\theta } \right) = \sin \theta \sqrt {v_0^2 \sin ^2 \theta - 2gh} \Rightarrow$$
*Then I multiply both sides by $${\sqrt {v_0^2 \sin ^2 \theta - 2gh} }$$ and then divide each side by $v_0$
$$v_0 \sqrt {v_0^2 \sin ^2 \theta - 2gh} \left( {\frac{{v_0 \sin \theta \cos ^2 \theta }}{{\sqrt {v_0^2 \sin ^2 \theta - 2gh} }} - \cos 2\theta } \right) = \sin \theta \left( {v_0^2 \sin ^2 \theta - 2gh} \right)$$
$$v_0 \cos ^2 \theta - \left( {\cos 2\theta } \right)\sqrt {v_0^2 - 2gh\csc ^2 \theta } = v_0 \sin ^2 \theta - 2gh \Rightarrow$$
$$\begin{gathered} \sqrt {v_0^2 - 2gh\csc ^2 \theta } = 2gh + 1 \Rightarrow \hfill \\ v_0^2 - 2gh\csc ^2 \theta = 4gh\left( {gh + 1} \right) + 1 \Rightarrow \hfill \\ - 2gh\csc ^2 \theta = v_0^2 - 4gh\left( {gh + 1} \right) - 1 \Rightarrow \hfill \\ \frac{1}{{\sin \theta }} = \sqrt {\frac{{v_0^2 - 4gh\left( {gh + 1} \right) - 1}}{{2gh}}} \Rightarrow \theta = \sin ^{ - 1} \left\{ {\left[ {\frac{{v_0^2 - 4gh\left( {gh + 1} \right) - 1}}{{2gh}}} \right]^{ - \frac{1}{2}} } \right\} \hfill \\ \end{gathered}$$

But I try a test with $h = 50m,\;v_0 = 100\frac{m}{s}$, and the optimal angle is not the one solved by the equation!

Last edited: Aug 16, 2005
2. Aug 16, 2005

### chronon

Shouldn't that be +2gh rather than -2gh within the square root? I would rewrite the quadratic with a positive t^2 term.

Last edited: Aug 16, 2005
3. Aug 16, 2005

### chronon

The denominator should be twice the t^2 term, which gives -g rather than 2h.

4. Aug 16, 2005

### bomba923

Of course! The determinant must have +2gh and the denominator must have -g. Taking that into consideration:

$$\begin{gathered} \left\{ \begin{gathered} x = v_0 t\cos \theta \hfill \\ y = h + v_0 t\sin \theta - \frac{{gt^2 }} {2} \hfill \\ \end{gathered} \right\} \Rightarrow \hfill \\ y = 0,\;t = \frac{{v_0 \sin \theta + \sqrt {v_0^2 \sin ^2 \theta + 2gh} }} {g} \Rightarrow \hfill \\ x = v_0 \cos \theta \frac{{v_0 \sin \theta + \sqrt {v_0^2 \sin ^2 \theta + 2gh} }} {g} = \frac{{v_0 }} {g}\left( {v_0 \sin \theta \cos \theta + \left( {\cos \theta } \right)\sqrt {v_0^2 \sin ^2 \theta + 2gh} } \right) \hfill \\ \end{gathered} \Rightarrow$$
$$\begin{gathered} \frac{{dx}}{{d\theta }} = \frac{{v_0 }}{g}\left[ {v_0 \cos 2\theta + \frac{{v_0^2 \sin \theta \cos ^2 \theta }}{{\sqrt {v_0^2 \sin ^2 \theta + 2gh} }} - \left( {\sin \theta } \right)\sqrt {v_0^2 \sin ^2 \theta + 2gh} } \right] = 0 \Rightarrow \hfill \\ v_0 \cos 2\theta + \frac{{v_0^2 \sin \theta \cos ^2 \theta }} {{\sqrt {v_0^2 \sin ^2 \theta + 2gh} }} - \left( {\sin \theta } \right)\sqrt {v_0^2 \sin ^2 \theta + 2gh} = 0 \Rightarrow \hfill \\ \end{gathered}$$

*Then I multiply both sides of the equation by
$$\frac{{\sqrt {v_0^2 \sin ^2 \theta + 2gh} }}{{v_0 \sin \theta }}$$
to get

$$\begin{gathered} \left( {\cos 2\theta } \right)\sqrt {v_0^2 + 2gh\csc ^2 \theta } + v_0 \cos 2\theta + 2v_0^{ - 1} gh = 0 \Rightarrow \hfill \\ - \sqrt {v_0^2 + 2gh\csc ^2 \theta } = v_0 + 2v_0^{ - 1} gh\sec 2\theta \Rightarrow \csc ^2 \theta = 2\sec 2\theta \left( {1 + v_0^{ - 2} gh\sec 2\theta } \right) \Rightarrow \hfill \\ \cot ^2 \theta - 1 = 2\left( {1 + v_0^{ - 2} gh\sec 2\theta } \right) \Rightarrow \cot ^2 \theta - 2v_0^{ - 2} gh\sec 2\theta = 3 \Rightarrow ?? \hfill \\ \end{gathered}$$

Hmm...and now I'm stuck! Any ideas?

5. Aug 17, 2005

### bomba923

How do I solve for $$\theta$$?
$$\frac{{dx}}{{d\theta }} = 0$$
Was there an error in my second attempt to calculate the $\theta$ such that
$$\frac{{dx}}{{d\theta }} = 0$$