Pendulum (mechanics)



A pendulum is a body suspended from a fixed support such that it freely swings back and forth under the influence of gravity. When a pendulum is displaced sideways from its resting, equilibrium position, it is subject to a restoring force due to gravity that will accelerate it back towards the equilibrium position. When released, the restoring force acting on the pendulum's mass causes it to oscillate about the equilibrium position, swinging it back and forth. The mathematics of pendulums are in general quite complicated. Simplifying assumptions can be made, which in the case of a simple pendulum allow the equations of motion to be solved analytically for small-angle oscillations.

Simple gravity pendulum
A simple gravity pendulum is an idealized mathematical model of a real pendulum. It is a weight (or bob) on the end of a massless cord suspended from a pivot, without friction. Since in the model there is no frictional energy loss, when given an initial displacement it swings back and forth with a constant amplitude. The model is based on the assumptions:
 * The rod or cord is massless, inextensible and always remains under tension.
 * The bob is a point mass.
 * The motion occurs in two dimensions.
 * The motion does not lose energy to external friction or air resistance.
 * The gravitational field is uniform.
 * The support is immobile.

The differential equation which governs the motion of a simple pendulum is

where $$ is the magnitude of the gravitational field, $g$ is the length of the rod or cord, and $ℓ$ is the angle from the vertical to the pendulum.

$θ$

Small-angle approximation
The differential equation given above is not easily solved, and there is no solution that can be written in terms of elementary functions. However, adding a restriction to the size of the oscillation's amplitude gives a form whose solution can be easily obtained. If it is assumed that the angle is much less than 1 radian (often cited as less than 0.1 radians, about 6°), or $$\theta \ll 1,$$ then substituting for $l$ into $$ using the small-angle approximation, $$\sin\theta\approx\theta,$$ yields the equation for a harmonic oscillator, $$\frac{d^2\theta}{dt^2}+\frac{g}{\ell} \theta=0.$$

The error due to the approximation is of order $F_{g}$ (from the Taylor expansion for $τ = dL⁄dt$).

Let the starting angle be $dθ⁄dt$. If it is assumed that the pendulum is released with zero angular velocity, the solution becomes $$ The motion is simple harmonic motion where $θ_{0}$ is the amplitude of the oscillation (that is, the maximum angle between the rod of the pendulum and the vertical). The corresponding approximate period of the motion is then $m$ which is known as Christiaan Huygens's law for the period. Note that under the small-angle approximation, the period is independent of the amplitude $y_{0}$; this is the property of isochronism that Galileo discovered.

Rule of thumb for pendulum length
$$T_0 = 2\pi\sqrt{\frac \ell g}$$ gives $$ \ell = \frac{g}{\pi^2}\frac{T_0^2} 4.$$

If SI units are used (i.e. measure in metres and seconds), and assuming the measurement is taking place on the Earth's surface, then $y_{1}$, and $dθ⁄dt$ (0.994 is the approximation to 3 decimal places).

Therefore, relatively reasonable approximations for the length and period are: $$\begin{align} \ell &\approx \frac{T_0^2}{4}, \\ T_0 &\approx 2 \sqrt\ell \end{align}$$ where $θ_{0}$ is the number of seconds between two beats (one beat for each side of the swing), and $g$ is measured in metres.

Arbitrary-amplitude period






For amplitudes beyond the small angle approximation, one can compute the exact period by first inverting the equation for the angular velocity obtained from the energy method ($l$), $$\frac{dt}{d\theta} = \sqrt\frac\ell{2g}\frac{1}{\sqrt{\cos\theta-\cos\theta_0}}$$ and then integrating over one complete cycle, $$T = t(\theta_0 \rightarrow 0 \rightarrow -\theta_0 \rightarrow 0 \rightarrow\theta_0),$$ or twice the half-cycle $$T = 2 t(\theta_0 \rightarrow 0 \rightarrow -\theta_0),$$ or four times the quarter-cycle $$T = 4 t(\theta_0 \rightarrow 0),$$ which leads to $$T = 4\sqrt\frac\ell{2g}\int^{\theta_0}_0 \frac{d\theta}{\sqrt{\cos\theta-\cos\theta_0}} .$$

Note that this integral diverges as $θ ≈ 0$ approaches the vertical $$ \lim_{\theta_0 \to \pi} T = \infty, $$ so that a pendulum with just the right energy to go vertical will never actually get there. (Conversely, a pendulum close to its maximum can take an arbitrarily long time to fall down.)

This integral can be rewritten in terms of elliptic integrals as $$T = 4\sqrt\frac\ell g F\left( \frac{\pi} 2, \sin \frac{\theta_0} 2\right) $$ where $θ$ is the incomplete elliptic integral of the first kind defined by $$F(\varphi, k) = \int_0^\varphi \frac {du} {\sqrt{1-k^2\sin^2 u}}\,.$$

Or more concisely by the substitution $$\sin{u} = \frac{\sin\frac{\theta}{2}}{\sin\frac{\theta_0}{2}}$$ expressing $$ in terms of $h$,

$h$ Here $$ is the complete elliptic integral of the first kind defined by

$$K(k) = F \left( \frac \pi 2, k \right) = \int_0^\frac{\pi}{2} \frac{du}{\sqrt{1-k^2\sin^2 u}}\,.$$

For comparison of the approximation to the full solution, consider the period of a pendulum of length 1 m on Earth ($$ = $$) at an initial angle of 10 degrees is $$4\sqrt{\frac{1\text{ m}}{g}}\ K\left(\sin\frac{10^\circ} {2} \right)\approx 2.0102\text{ s}.$$ The linear approximation gives

$$2\pi \sqrt{\frac{1\text{ m}}{g}} \approx 2.0064\text{ s}.$$

The difference between the two values, less than 0.2%, is much less than that caused by the variation of $$ with geographical location.

From here there are many ways to proceed to calculate the elliptic integral.

Legendre polynomial solution for the elliptic integral
Given $l$ and the Legendre polynomial solution for the elliptic integral: $$K(k) =\frac{\pi}{2}\sum_{n=0}^\infty \left(\frac{(2n-1)!!}{(2n)!!}k^{n}\right)^{2}$$ where $sin θ ≈ θ$ denotes the double factorial, an exact solution to the period of a simple pendulum is: $$\begin{alignat}{2} T & = 2\pi \sqrt\frac \ell g \left( 1+ \left( \frac{1}{2} \right)^2 \sin^2 \frac{\theta_0}{2} + \left( \frac{1 \cdot 3}{2 \cdot 4} \right)^2 \sin^4 \frac{\theta_0}{2} + \left( \frac {1 \cdot 3 \cdot 5}{2 \cdot 4 \cdot 6} \right)^2 \sin^6 \frac{\theta_0}{2} + \cdots \right) \\ & = 2\pi \sqrt\frac\ell g \cdot \sum_{n=0}^\infty \left( \left ( \frac{(2n)!}{( 2^n \cdot n! )^2} \right )^2 \cdot \sin^{2 n}\frac{\theta_0}{2} \right).\end{alignat}$$

Figure 4 shows the relative errors using the power series. $sin θ$ is the linear approximation, and $θ$ to $sin θ$ include respectively the terms up to the 2nd to the 10th powers.

Power series solution for the elliptic integral
Another formulation of the above solution can be found if the following Maclaurin series: $$\sin \frac{\theta_0} 2 =\frac12\theta_0 - \frac{1}{48}\theta_0^3 + \frac{1}{3\,840}\theta_0^5 - \frac{1}{645\,120}\theta_0^7 + \cdots.$$ is used in the Legendre polynomial solution above. The resulting power series is:

$$T = 2\pi \sqrt\frac\ell g \left( 1+ \frac{1}{16}\theta_0^2 + \frac{11}{3\,072}\theta_0^4 + \frac{173}{737\,280}\theta_0^6 + \frac{22\,931}{1\,321\,205\,760}\theta_0^8 + \frac{1\,319\,183}{951\,268\,147\,200}\theta_0^{10} + \frac{233\,526\,463}{2\,009\,078\,326\,886\,400}\theta_0^{12} + \cdots \right),$$ more fractions available in the On-Line Encyclopedia of Integer Sequences with having the numerators and  having the denominators.

Arithmetic-geometric mean solution for elliptic integral
Given $x$ and the arithmetic–geometric mean solution of the elliptic integral: $$K(k) = \frac {\pi}{2 M(1-k,1+k)},$$ where $θ_{0}$ is the arithmetic-geometric mean of $$ and $F$.

This yields an alternative and faster-converging formula for the period: $$T = \frac{2\pi}{M\left(1, \cos\frac{\theta_0} 2 \right)} \sqrt\frac\ell g.$$

The first iteration of this algorithm gives $$T_1 = \frac{2T_0}{1 + \cos \frac{\theta_0}{2}}. $$

This approximation has the relative error of less than 1% for angles up to 96.11 degrees. Since $\frac{1}{2}\left(1+\cos\left(\frac{\theta_0}{2}\right)\right) = \cos^2 \frac{\theta_0}{4},$ the expression can be written more concisely as $$T_1 = T_0 \sec^2 \frac{\theta_0}{4}.$$

The second order expansion of $$\sec^2(\theta_0/4)$$ reduces to $T \approx T_0 \left(1 + \frac{\theta_0^2}{16} \right).$

A second iteration of this algorithm gives $$T_2 = \frac{4T_0}{1 + \cos \frac{\theta_0}{2} + 2\sqrt{\cos \frac{\theta_0}{2}}} = \frac{4T_0}{\left(1 + \sqrt{\cos \frac{\theta_0}{2}} \right)^2}. $$

This second approximation has a relative error of less than 1% for angles up to 163.10 degrees.

Approximate formulae for the nonlinear pendulum period
Though the exact period $$T$$ can be determined, for any finite amplitude $$\theta_0 < \pi$$ rad, by evaluating the corresponding complete elliptic integral $$K(k)$$, where $$k \equiv \sin(\theta_0/2)$$, this is often avoided in applications because it is not possible to express this integral in a closed form in terms of elementary functions. This has made way for research on simple approximate formulae for the increase of the pendulum period with amplitude (useful in introductory physics labs, classical mechanics, electromagnetism, acoustics, electronics, superconductivity, etc. The approximate formulae found by different authors can be classified as follows:


 * ‘Not so large-angle’ formulae, i.e. those yielding good estimates for amplitudes below $$\pi/2$$ rad (a natural limit for a bob on the end of a flexible string), though the deviation with respect to the exact period increases monotonically with amplitude, being unsuitable for amplitudes near to $$\pi$$ rad. One of the simplest formulae found in literature is the following one by Lima (2006): $T \approx -\,T_0 \, \frac{\ln{a}}{1-a}$, where $$a \equiv \cos{(\theta_0/2)}$$.
 * ‘Very large-angle’ formulae, i.e. those which approximate the exact period asymptotically for amplitudes near to $$\pi$$rad, with an error that increases monotonically for smaller amplitudes (i.e., unsuitable for small amplitudes). One of the better such formulae is that by Cromer, namely: $T \approx \frac{2}{\pi}\,T_0\,\ln{(4/a)}$.

Of course, the increase of $$T$$ with amplitude is more apparent when $$\pi/2<\theta_0<\pi$$, as has been observed in many experiments using either a rigid rod or a disc. As accurate timers and sensors are currently available even in introductory physics labs, the experimental errors found in ‘very large-angle’ experiments are already small enough for a comparison with the exact period, and a very good agreement between theory and experiments in which friction is negligible has been found. Since this activity has been encouraged by many instructors, a simple approximate formula for the pendulum period valid for all possible amplitudes, to which experimental data could be compared, was sought. In 2008, Lima derived a weighted-average formula with this characteristic: $$T \approx \frac{r\,a^2\,T_\text{Lima} +k^2\,T_\text{Cromer}}{r\,a^2+k^2},$$ where $$r = 7.17$$, which presents a maximum error of only 0.6% (at $$\theta_0 = 95^\circ$$).

Arbitrary-amplitude angular displacement
The Fourier series expansion of $$\theta(t)$$ is given by

$$ \theta(t) = 8\sum_{n \geq 1\text{ odd}}\frac{(-1)^{\left\lfloor{n/2}\right\rfloor}}{n}\frac{q^{n/2}}{1+q^{n}}\cos(n\omega t) $$

where $$q$$ is the elliptic nome, $$q=\exp\left({-\pi K\bigl(\sqrt{\textstyle 1-k^2}\bigr) \big/ K(k)}\right),$$ $$k=\sin (\theta_0/2),$$ and $$\omega=2\pi/T$$ the angular frequency.

If one defines $$\varepsilon=\frac12\cdot \frac{1-\sqrt{\cos(\theta_0/2)}}{1+\sqrt{\cos(\theta_0/2)}} $$ $$q$$ can be approximated using the expansion $$q = \varepsilon + 2\varepsilon^5 + 15\varepsilon^{9} + 150\varepsilon^{13} + 1707\varepsilon^{17} + 20910\varepsilon^{21} + \cdots $$ (see ). Note that $$\varepsilon < \tfrac 1 2$$ for $$\theta_0<\pi$$, thus the approximation is applicable even for large amplitudes.

Equivalently, the angle can be given in terms of the Jacobi elliptic function $$\operatorname{cd}$$ with modulus $$k$$ $$\theta(t)=2\arcsin\left(k\operatorname{cd}\left(\sqrt{\frac{g}{\ell}}t;k\right)\right),\quad k=\sin\frac{\theta_0}{2}.$$

For small $$x$$, $$\sin x\approx x$$, $$\arcsin x\approx x$$ and $$\operatorname{cd}(t;0)=\cos t$$, so the solution is well-approximated by the solution given in Pendulum (mechanics).

Examples
The animations below depict the motion of a simple (frictionless) pendulum with increasing amounts of initial displacement of the bob, or equivalently increasing initial velocity. The small graph above each pendulum is the corresponding phase plane diagram; the horizontal axis is displacement and the vertical axis is velocity. With a large enough initial velocity the pendulum does not oscillate back and forth but rotates completely around the pivot.

Compound pendulum
A compound pendulum (or physical pendulum) is one where the rod is not massless, and may have extended size; that is, an arbitrarily shaped rigid body swinging by a pivot $$O$$. In this case the pendulum's period depends on its moment of inertia $$I_O$$ around the pivot point.

The equation of torque gives: $$\tau = I \alpha$$ where: $$\alpha$$ is the angular acceleration. $$\tau$$ is the torque

The torque is generated by gravity so: $$\tau = - m g r_\oplus \sin\theta$$ where:
 * $$m$$ is the total mass of the rigid body (rod and bob)
 * $$r_\oplus$$ is the distance from the pivot point to the system's centre-of-mass
 * $$\theta$$ is the angle from the vertical

Hence, under the small-angle approximation, $$\sin\theta\approx\theta$$ (or equivalently when $$\theta_\mathrm{max}\ll 1$$), $$\alpha = \ddot{\theta} = \frac{mgr_\oplus}{I_O}\sin\theta \approx -\frac{mgr_\oplus}{I_O}\theta$$ where $$I_O$$ is the moment of inertia of the body about the pivot point $$O$$.

The expression for $$\alpha$$ is of the same form as the conventional simple pendulum and gives a period of $$T = 2 \pi \sqrt{\frac{I_O}{mgr_\oplus}}$$

And a frequency of $$f = \frac{1}{T} = \frac{1}{2\pi} \sqrt{\frac{mgr_\oplus}{I_O}}$$

If the initial angle is taken into consideration (for large amplitudes), then the expression for $$\alpha$$ becomes: $$\alpha = \ddot{\theta} = -\frac{mgr_\oplus}{I_O}\sin\theta$$ and gives a period of: $$T = 4 \operatorname{K}\left(\sin^2\frac{\theta_\mathrm{max}}{2}\right) \sqrt{\frac{I_O}{mgr_\oplus}}$$ where $$\theta_\mathrm{max}$$ is the maximum angle of oscillation (with respect to the vertical) and $$\operatorname{K}(k)$$ is the complete elliptic integral of the first kind.

An important concept is the equivalent length, $$\ell^\mathrm{eq}$$, the length of a simple pendulums that has the same angular frequency $$\omega_0$$ as the compound pendulum: $$ {\omega_0}^2 = \frac{g}{\ell^\mathrm{eq}} := \frac{mgr_\oplus}{I_O} \implies \ell^\mathrm{eq} = \frac{I_O}{mr_\oplus} $$

Consider the following cases: $${\omega_0}^2 = \frac{mgr_\oplus}{I_O}=\frac{\left(m_\mathrm{bob}\ell+m_\mathrm{rod}\frac{\ell}{2}\right)g}{m_\mathrm{bob}\ell^2+\frac{1}{3}m_\mathrm{rod}\ell^2} = \frac{g}{\ell} \frac{m_\mathrm{bob}+\frac{m_\mathrm{rod}}{2}}{m_\mathrm{bob}+\frac{m_\mathrm{rod}}{3}} = \frac{g}{\ell} \frac{1+\frac{m_\mathrm{rod}}{2m_\mathrm{bob}}}{1+\frac{m_\mathrm{rod}}{3m_\mathrm{bob}}} $$ Where $$\ell^\mathrm{eq} = \ell \frac{1+\frac{m_\mathrm{rod}}{3m_\mathrm{bob}}} {1+\frac{m_\mathrm{rod}}{2m_\mathrm{bob}}} $$. Notice these formulae can be particularized into the two previous cases studied before just by considering the mass of the rod or the bob to be zero respectively. Also notice that the formula does not depend on both the mass of the bob and the rod, but actually on their ratio, $$\frac{m_\mathrm{rod}}{m_\mathrm{bob}}$$. An approximation can be made for $$\frac{m_\mathrm{rod}}{m_\mathrm{bob}}\ll 1$$:
 * The simple pendulum is the special case where all the mass is located at the bob swinging at a distance $$\ell$$ from the pivot. Thus, $$r_\oplus=\ell$$ and $$I_O=m\ell^2$$, so the expression reduces to: $${\omega_0}^2 = \frac{mgr_\oplus}{I_O}=\frac{mg\ell}{m\ell^2}=\frac{g}{\ell}$$ . Notice $$\ell^\mathrm{eq}=\ell$$, as expected (the definition of equivalent length).
 * A homogeneous rod of mass $$m$$ and length $$\ell$$ swinging from its end has $$r_\oplus=\frac{1}{2}\ell$$ and $$I_O=\frac{1}{3}m\ell^2$$, so the expression reduces to: $${\omega_0}^2 = \frac{mgr_\oplus}{I_O}=\frac{mg\,\frac{1}{2}\ell}{\frac{1}{3}m\ell^2}=\frac{g}{\frac{2}{3}\ell}$$ . Notice $$\ell^\mathrm{eq}=\frac{2}{3}\ell$$, a homogeneous rod oscilates as if it were a simple pendulum of two-thirds its length.
 * A heavy simple pendulum: combination of a homogeneous rod of mass $$m_\mathrm{rod}$$ and length $$\ell$$ swinging from its end, and a bob $$m_\mathrm{bob}$$ at the other end. Then the system has a total mass of $$m_\mathrm{bob}+m_\mathrm{rod}$$, and the other parameters being $$m r_\oplus=m_\mathrm{bob}\ell+m_\mathrm{rod}\frac{\ell}{2}$$ (by definition of centre-of-mass) and $$I_O=m_\mathrm{bob}\ell^2+\frac{1}{3}m_\mathrm{rod}\ell^2$$, so the expression reduces to:

$${\omega_0}^2 \approx \frac{g}{\ell} \left( 1+\frac{1}{6}\frac{m_\mathrm{rod}}{m_\mathrm{bob}}+\cdots\right)$$

Notice how similar it is to the angular frequency in a spring-mass system with effective mass.

Damped, driven pendulum
The above discussion focuses on a pendulum bob only acted upon by the force of gravity. Suppose a damping force, e.g. air resistance, as well as a sinusoidal driving force acts on the body. This system is a damped, driven oscillator, and is chaotic.

Equation (1) can be written as

$$ml^2 \frac{d^2 \theta}{dt^2} = -mgl \sin \theta$$

(see the Torque derivation of Equation (1) above).

A damping term and forcing term can be added to the right hand side to get

$$ml^2 \frac{d^2 \theta}{dt^2} = -mgl\sin \theta - b\frac{d\theta}{dt} + a\cos(\Omega t)$$

where the damping is assumed to be directly proportional to the angular velocity (this is true for low-speed air resistance, see also Drag (physics)). $$a$$ and $$b$$ are constants defining the amplitude of forcing and the degree of damping respectively. $\Omega$ is the angular frequency of the driving oscillations.

Dividing through by $ml^2$ :

$$\frac{d^2 \theta}{dt^2} + \frac{b}{ml^2}\frac{d\theta}{dt} + \frac{g}{l}{\sin \theta} - \frac{a}{ml^2}\cos (\Omega t) = 0.$$

For a physical pendulum:

$$\frac{d^2 \theta}{dt^2} + \frac{b}{I}\frac{d\theta}{dt} + \frac{mgr_\oplus}{I}{\sin \theta} - \frac{a}{I}\cos (\Omega t) = 0.$$

This equation exhibits chaotic behaviour. The exact motion of this pendulum can only be found numerically and is highly dependent on initial conditions, e.g. the initial velocity and the starting amplitude. However, the small angle approximation outlined above can still be used under the required conditions to give an approximate analytical solution.

Physical interpretation of the imaginary period
The Jacobian elliptic function that expresses the position of a pendulum as a function of time is a doubly periodic function with a real period and an imaginary period. The real period is, of course, the time it takes the pendulum to go through one full cycle. Paul Appell pointed out a physical interpretation of the imaginary period: if $θ_{0}$ is the maximum angle of one pendulum and $θ_{0}$ is the maximum angle of another, then the real period of each is the magnitude of the imaginary period of the other.

Coupled pendula
Coupled pendulums can affect each other's motion, either through a direction connection (such as a spring connecting the bobs) or through motions in a supporting structure (such as a tabletop). The equations of motion for two identical simple pendulums coupled by a spring connecting the bobs can be obtained using Lagrangian mechanics.

The kinetic energy of the system is: $$E_\text{K}=\frac{1}{2}mL^2\left(\dot\theta_1^2+\dot\theta_2^2\right)$$ where $$m$$ is the mass of the bobs, $$L$$ is the length of the strings, and $$\theta_1$$, $$\theta_2$$ are the angular displacements of the two bobs from equilibrium.

The potential energy of the system is: $$E_\text{p}=mgL(2-\cos\theta_1-\cos\theta_2)+\frac{1}{2}kL^2(\theta_2-\theta_1)^2$$

where $$g$$ is the gravitational acceleration, and $$k$$ is the spring constant. The displacement $$L(\theta_2-\theta_1)$$ of the spring from its equilibrium position assumes the small angle approximation.

The Lagrangian is then $$\mathcal{L}=\frac{1}{2}mL^2\left(\dot\theta_1^2+\dot\theta_2^2\right)-mgL(2-\cos\theta_1-\cos\theta_2)-\frac{1}{2} k L^2(\theta_2-\theta_1)^2$$ which leads to the following set of coupled differential equations: $$\begin{align} \ddot\theta_1+\frac{g}{L}\sin\theta_1+\frac{k}{m}(\theta_1-\theta_2)&=0 \\ \ddot\theta_2+\frac{g}{L}\sin\theta_2-\frac{k}{m}(\theta_1-\theta_2)&=0 \end{align}$$

Adding and subtracting these two equations in turn, and applying the small angle approximation, gives two harmonic oscillator equations in the variables $$\theta_1+\theta_2$$ and $$\theta_1-\theta_2$$: $$\begin{align} \ddot\theta_1+\ddot\theta_2+\frac{g}{L}(\theta_1+\theta_2)&=0 \\ \ddot\theta_1-\ddot\theta_2+\left(\frac{g}{L}+2\frac{k}{m}\right)(\theta_1-\theta_2)&=0 \end{align}$$ with the corresponding solutions $$\begin{align} \theta_1+\theta_2&=A\cos(\omega_1t+\alpha) \\ \theta_1-\theta_2&=B\cos(\omega_2t+\beta) \end{align}$$ where $$\begin{align} \omega_1&=\sqrt{\frac{g}{L}} \\ \omega_2&=\sqrt{\frac{g}{L}+2\frac{k}{m}} \end{align}$$

and $$A$$, $$B$$, $$\alpha$$, $$\beta$$ are constants of integration.

Expressing the solutions in terms of $$\theta_1$$ and $$\theta_2$$ alone: $$\begin{align} \theta_1&=\frac{1}{2}A\cos(\omega_1t+\alpha)+\frac{1}{2}B\cos(\omega_2t+\beta) \\ \theta_2&=\frac{1}{2}A\cos(\omega_1t+\alpha)-\frac{1}{2}B\cos(\omega_2t+\beta) \end{align}$$

If the bobs are not given an initial push, then the condition $$\dot\theta_1(0)=\dot\theta_2(0)=0$$ requires $$\alpha=\beta=0$$, which gives (after some rearranging): $$\begin{align} A&=\theta_1(0)+\theta_2(0)\\ B&=\theta_1(0)-\theta_2(0) \end{align}$$