2nd Order Type 2 PLL for Tracking Frequency Error This is a "DSP Puzzle", Please preface your answer with spoiler notation by typing the following two characters first ">!" as the intention is for readers to think through what the solution might be first (the ones that want to participate, others can hover over immediately to see the solution).

A second order "type 2" Phase Lock Loop is required in order to track a phase ramp with time with zero error. A phase ramp is a frequency step. Similarly a third order "type 3" PLL would be required to track a frequency ramp (phase acceleration), which I have summarized in the graphic below. The "Type" refers to the number of poles in the open loop transfer function at the $s=0$ in continuous time or $z=1$ in discrete time loops, since these represent pure integrators. An integrator has infinite gain at DC and hence infinite suppression of DC error. 

A second order type 2 PLL is often implemented with a proportional-integral loop filter, adding the second pole in addition to the oscillator which has an inherent pole since it integrates phase (controlling the output frequency of the oscillator directly is controlling the integral of the phase of the output). 

The question is: There is a way to implement a similar tracking system to track a phase ramp with zero error using two first order PLL's. How do we do this?
Notation: Incoming carrier frequency : $f_c$ and Local Oscillators synthesized frequency : $f_o$.   A First Order PLL to track a constant phase offset $(\phi)$ in the received carrier sinusoidal is based on the following PLL daigram. In working of the single PLL Loop it is essential that $f_c = f_o$:  (image courtesy : Software Receiver Design by Johnson, Sethares &amp; Klein) Here, $r_p(kT_s) = BPF_{2f_c} \{ r(kT_s)^2 \}$, meaning received signal is squared and then bandpass filtered with BPF's center frequency at twice carrier frequency $2f_c$. This preprocessing is done to emphasize the carrier, since this will boost carrier SNR. So, input to the PLL is basically, $$r_p(kT_s) = cos(4\pi f_c k T_s + 2\phi)$$Now if instead of constant phase offset of $\phi$ if we are having a constant frequency offset of $\Delta f = f_c - f_{o}$ and a constant phase offset of $\phi$ in carrier frequency then, we can extent this single PLL Loop to a combination of 2 PLL loops as follows: (image courtesy : Software Receiver Design by Johnson, Sethares &amp; Klein)  Here, input to this frequency Tracking PLL is as follows: $$r_p(kT_s) = cos(4\pi (f_c - \Delta f)k T_s + 2\phi)$$  Now, if the first Loop processing is worked out, it can be shown that it tracks a ramp:$$\theta_1[k] \rightarrow 2\pi (f_c - f_{o})k + \beta$$, where $\beta$ is the y-intercept of the ramp being tracked by first PLL.This is added to $\theta_2[k]$, which makes it possible for the $2^{nd}$ PLL to track the frequency accurately :$$\theta_2[k] \rightarrow \phi - \beta$$ , which mean, $$\theta_1[k] + \theta_2[k] \rightarrow 2\pi (f_c - f_{o}) + \beta + \phi -\beta$$ $$\theta_1[k] + \theta_2[k] \rightarrow 2\pi (f_c - f_{o}) + \phi$$, And this sum is being used to drive the sinusoid of Local Oscillator, hence the local oscillator is now generating a sinusoid which is synchronized with $r_p(kT_s)$ in both frequency and phase. Basically, top PLL Loop is tracking a ramp and hence generating the correct frequency for the bottom loop, and bottom loop is further correcting the residual phase error.(image courtesy : Software Receiver Design by Johnson, Sethares &amp; Klein)