A heart pacemaker, shown in Figure 3.1.15, consists of a switch, a battery, a capacitor, and the heart as a resistor. When the switch Sis at P, the capacitor charges; when Sis atQ, the capacitor discharges, sending an electrical stimulus to the heart. In Problem 58 in Exercises 2.3 we saw that during this time the electrical stimulus is being applied to the heart, the voltageE across the heart satisfies the linearDE.
(a) Let us assume that over the time interval of length the switch S is at position P shown in Figure 3.1.15 and the capacitor is being charged. When the switch is moved to position Q at time the capacitor dis-charges, sending an impulse to the heart over the time interval of length . Thus over the initial charging/discharging interval the voltage to the heart is actually modelled by the piecewise-linear differential equation
By moving S between P and Q, the charging and discharging over time intervals of lengths and is

Repeated indenitely. Suppose , and and so on. Solve for for .
(b) Suppose for the sake of illustration that . Use a graphing utility to graph the solution for the IVP in part (a) for