What is the current of a capacitor when the derivative of voltage is undefined? This is from the textbook I am reading:

I know this equation for capacitors:
$$i=C\cdot \frac { dv }{ dt }$$
Here is my question: how can diagram (a) be allowed if the derivative of the voltage with respect to time is undefined at one instant?
Specifically, at this instant:

What is the current at that instant? Is it undefined? Can current be undefined in real life?
 A: If you have just given the voltage signal with
$$
\def\l{\left}\def\r{\right}
v(t) = \l(2-\l|\frac t{\rm s}-2\r|\r)\rm V
$$
then the current at $t=2\rm s$ is undefined. Right. But, in most cases really nobody cares.
What we learn theoretically about the current from the above voltage signal definition is that
$$
i(t) = \begin{cases}
C\cdot 1\frac{\rm V}{\rm s} & @ t< 2\rm s\\
-C\cdot 1\frac{\rm V}{\rm s} &@ t> 2\rm s
\end{cases}
$$
The only statement at $t=2\rm s$ for $i(t)$ is that it keeps finite. Nothing more.
In practice if you zoom in on the time scale of the oscilloscope you will see that the current does not jump because of very small parasitic inductances in the circuit. Therefore, the signal of the capacitor voltage will not have sharp angles as the given wave form suggests.
But, in many cases this is not relevant for the calculation at hand and one just ignores the roundings of the voltage signal to keep the calculation simple.
Approximation and abstraction are two important elements of engineering.
If you really need a defined value for the current $i(t)$ at $t=2$ for the computer calculation you can agree on left- or right-continuous signals.

The formalism of Sobolev-spaces and weak derivatives handles this kind of abstraction. It regards all signals as equivalent as long as they only differ on a time-set of zero measure. For an instance two signals that only differ on a finite set of time-points are equivalent.
This takes into account that every measurement of a signal needs some finite interval of time.
A: In figure (a), the voltage is continuous but the time derivative is not; the capacitor current would discontinuously change sign from positive to negative.  
In figure (b) however, the voltage is discontinuous.  It is typically said that the voltage across an ideal capacitor is continuous since, for the current to exist, the time derivative of the voltage must exist.  
However, in the context of distributions, then for example, the voltage across the ideal capacitor can be the unit step $u(t)$ which implies an impulse of current
$$i_C(t) = C\frac{d}{dt}u(t) = C\delta(t)$$
Mathematically, this is sound.  Physically, this is absurd since the assumptions upon which this result is based are invalid.
The ideal circuit theory approximation holds only when we can ignore electromagnetic effects which is to say, we assume appropriately slow changing currents and voltages such that, e.g., self inductance can be ignored.
An 'infinite' rate of change would 'infinitely' violate that assumption, i.e., we would have to account for electromagnetic radiation which involves adding 'parasitic' circuit elements into the equation.
A: Well,  if you look at a practical circuit which produces that graph, there must be a sudden drastic change in the circuit at that instant of time to cause the capacitor to abruptly shift mode from charging to discharging - quite possibly a switch/switches were turned on/off effectively putting the capacitor in a different circuit. If you are asking the question, what's happening to the current while that switch was being turned on/off, the analysis of that would be a more complex problem involving equations not as simple as kirchoff's laws. The current would be in a rapidly transitory phase. Thus, the 'undefined' value for current at that particular instant of time only reflects the failure of the mathematical model used for producing those graphs - which in this case would be kirchoff's laws and other associated equations for the capacitor. It simply means that that model is inadequate for calculating the current at that instant. It does not really mean that the current itself is valueless, current, being a physical quantity would have a value either non-zero or zero at every instant of time.
A: There never is any confusion or contradiction because, unlike charge, the current does not have to be continuous, that is $i(t-0) = Cv'(t-0)$ and $i(t+0)=Cv'(t+0)$. Since time's flow is unidirectional, from $ - $ to $ + $, the time derivative of the voltage is well defined to mean $f'(t-0)$ and $f'(t+0)$. 
