Now, for starters, when I Plot it, a discontinuity appears. This can easily be solved with a simple Exclusions -> None option in the Plotcommand.

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).

2 Answers
2

The problem with your original formulation is that D[psi[t],t] does not evaluate to a function, it is instead d_t. The first derivative is not discontinuous, as a function, but it does have different definitions that correspond to the points where your Piecewise function changes.

Mathematica is a registered trademark of Wolfram Research, Inc. While the mark is used herein with the limited permission of Wolfram Research, Stack Exchange and this site disclaim all affiliation therewith.