I have this piecewise continuous function which is also continuously differentiable over time :
psi[t_] := Piecewise[{{(1 + t)^3 (-3 t^2 + t), -1 <= t <= 0},
{(1 - t)^3 (3 t^2 + t), 0 <= t <= 1}}];
Now, for starters, when I Plot
it, a discontinuity appears. This can easily be solved with a simple Exclusions -> None
option in the Plot
command.
But then, when I calculate its first derivative over time using D
, I obtain the following:
D[psi[t], t]
And then when I try to plot it :
- Is there something wrong with my original
psi[t_]
function? (Is it not continuous for Mathematica?) - Why are the limits of definition of the first derivative modified?
- Why is the first derivative discontinuous?
Now, the easy solution would be to construct the first derivative using the results proposed by the D
function and re-defining the definition domain... But I really want to understand this issue (if there is one).
Plot[Evaluate[D[psi[t], t]], {t, -1, 1}]
orPlot[D[psi[x], x] /. x -> t, {t, -1, 1}]
, orPlot[D[psi[t], t], {t, -1, 1}, Evaluated -> True]
. $\endgroup$