On this page, under the heading "Orbit Calculations": http://underactuated.mit.edu/pend.html or here.

The author says,

"This equation has a real solution when $\cos{\theta} > \cos{\theta_{\rm max}}$"

and then they give a piecewise function for $\theta_{\rm max}$.

I have no idea how these statement and function were derived from $\dot{\theta}(t) = \pm \sqrt{\frac{2}{I}\dots}$

Can someone show the exact steps to get to this derivation?

  • 1
    $\begingroup$ The link doesn't seem to work. Could you please elaborate your own efforts to derive or some key steps provided on the page given in that link? $\endgroup$ Commented May 31, 2020 at 0:53
  • $\begingroup$ The link is working when I checked, here is a screenshot of the section I am talking about: snipboard.io/WrOIGL.jpg @Ishika_96_sparkle $\endgroup$
    – user3180
    Commented May 31, 2020 at 0:58
  • 9
    $\begingroup$ The link works for me, however we like questions (and answers) to be stand-alone and you would ideally reproduce the key equations here using Mathjax in case the link goes dead at some time in the future. Note photos of pages are generally not desirable as the text cannot be searched through (by the site engine) nor can the math. $\endgroup$ Commented May 31, 2020 at 1:36

3 Answers 3


If the pendulum has enough energy to go all the way around, then any value for $\theta$ is possible between 0 (hanging down) and $\pi$ (standing straight up). For simplicity, take $\theta$ to be the absolute value of the angle between the pendulum and $-\hat{y}$ since the situation is invariant under $\theta\to -\theta$.

If the pendulum does not have enough energy to go all the way around then it will only be able to reach a maximum $\theta_m<\pi$. Given an energy $E$ the pendulum can rise only as high as $$ E=mgh=-mg\ell\cos(\theta_m)\\ \Downarrow\\ \theta_m=\cos^{-1}\left(\frac{-E}{mg\ell}\right) $$ Seems the textbook has a missing negative sign. This is because at the maximum height, all the kinetic energy has been converted to potential energy. Note $h$ is measured from the anchor point not the bob as is often done.

It only has a real solution when $\cos(\theta)\leq \cos(\theta_m)$ otherwise the potential energy $-mg\ell\cos(\theta)$, would exceed the total available energy $-mg\ell\cos(\theta_m)$ and the quantity under the radical ($E_0-U$) would be negative and thus would be an imaginary solution.

  • $\begingroup$ Its definitely a typo in the notes. The thing about piecewise function is separating the two cases i.e. when the pendulum is in unstable equilibrium at $\pi$ or vertically placed and all the other values decribed by the ratio of total to potential energy inside the ArcCos term. $\endgroup$ Commented May 31, 2020 at 6:02
  • $\begingroup$ I don't think so, it's annoying to keep flipping back and forth between the link and this app (I'm on mobile) so I kept editing my answer as I realized I misread. But I think it's all correct and my answer should fill in the missing steps, yes? $\endgroup$
    – bRost03
    Commented May 31, 2020 at 6:05
  • $\begingroup$ @bRost03 Can you explain more why you ignore the kinetic energy in your equation for E? Are you saying $\theta$ is maximized when all energy is potential, no kinetic? Does the max in $\theta_{max}$ refer to maximizing $\theta$ or maximizing the Cartesian y-coordinate? $\endgroup$
    – user3180
    Commented May 31, 2020 at 7:35
  • 1
    $\begingroup$ Maximizing $h$, $y$, $\theta_m$ or minimizing $U$ are all the same because $\cos$ is strictly decreasing between 0 and $\pi$. Yes we ignore kinetic energy because at the highest possible there is no kinetic energy left, it's all been converted to potential. $\endgroup$
    – bRost03
    Commented May 31, 2020 at 13:49
  • $\begingroup$ @bRost03 I think you meant to say maximizing $U$, not minimizing, in your last statement. The idea is that negative $-\cos(\theta)$ is monotonically increasing between 0 and $\pi$. $\endgroup$
    – user3180
    Commented May 31, 2020 at 17:37

As mentioned above by @bRost03, the condition to be obtained, is when the the angular displacement, is maximum $\theta=\theta_{\text{max}}$ and thus $\dot{\theta}_{\text{ma}x}=0$. Then, the condition becomes
$$\pm \sqrt{ \frac{2}{I} \big[E+ mgl \,\cos[\theta_{\text{max}}(t)]\big]}=0$$ or $$\cos[\theta_{\text{max}}(t)] =\frac{-E}{mgl} \implies \theta_{\text{max}}(t)= \cos^{-1} \left[\frac{-E}{mgl} \right]$$

Mathematically speaking, the range of $\cos^{-1}(\cdots)$ is $[0,\pi]$. The value of $\pi$ is achieved only in the case the pendulum is standing vertically upwards. The ratio $\frac{-E}{mgl}$ cannot be greater than $\pm 1$ as it would be outside the domain of inverse cosine function.


In this section, the textbook author is trying to say, how can we solve exactly for a mapping from $\theta$ to $\dot{\theta}$ without sampling points from that mapping and plotting onto a vector field.

The author's answer begins with the equation for total energy, and algebraically isolates the $\dot{\theta}$ on the left hand side, giving us the desired mapping from $\theta$ to $\dot{\theta}$.

In the section mentioning:

This equation has a real solution when $\cos{(\theta)} \gt$ $\cos{(\theta_{max})}$ ...

The author is showing here that the real solutions to this equation correspond to configurations of the pendulum that actually matches our physical intuition of the pendulum.

$\dot{\theta}$ only has a real solution when the input to the square root is positive.

$$\begin{align}E_0 &= E \\ E + m g l \cos{(\theta)} &\geq 0 \\ \cos{(\theta)} &\gt [\frac{E}{-mgl} = \cos{(\theta_{max})} ]\\ \end{align}$$

We solve for $\theta_{max}$. Note, although $\cos^{-1}$ is not a true inverse for cosine, using it as an inverse works here because the domain of $\cos$ we care about is only between $-\pi$ and $\pi$, which covers the entire range of angular positions the pendulum joint can take.

$$\theta_{max} = \cos^{-1}(\frac{E}{-mgl})$$

(The version in the textbook with $\theta_{max} = \cos^{-1}(\frac{E}{mgl})$ is a typo, there should be a negative sign inside the $\cos^{-1}$).

The piecewise expression in the textbook is just rewriting the above equation to expose the maximum value of $\theta_{max}$. If you plot the $\cos^{-1}$, you see it takes on a maximum value at $\pi$. This aligns with our intuition that $\cos{(\theta_{max})} = \cos{(\pi)}$ maximizes our Cartesian height of the pendulum over all configurations, while obeying conservation of energy.

Credit for the algebra and answer that helped me understand this section goes to @bRost03.

  • $\begingroup$ In the link you provided, there is no negative sign in the inverse cosine term. The negative sign comes because of the simple algebra manipulation of the equation. $\endgroup$ Commented Jun 1, 2020 at 3:02
  • $\begingroup$ @Ishika_96_sparkle You are correct. Check my updated answer, there should be a negative sign inside, based on the derivation in my post. $\endgroup$
    – user3180
    Commented Jun 1, 2020 at 3:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.