I've been trying to solve an ODE as shown below. The solution is correct. However, while trying to compare the Mathematica solution to the solution I had found by hand (which was not simplified), I decided to plot the two and compare. The plot of the Mathematica result shows an odd linear jump.
soln2 = FullSimplify[
DSolveValue[{y''[t] + 9 y[t] == Cos[2 t], y[0] == 1, y'[0] == -2}, y[t], t]]
1/5 (Cos[2 t] + 4 Cos[3 t]) - 2/3 Sin[3 t]
Plot[soln, {t, 1, 100}, ImageSize -> Medium]
When trying some other intervals, like 1 to 100 or 0 to 99, or seemingly anything other than 0-100, I have the periodic result I expected with no sudden linear parts.
Evaluating by hand around this area in the interval reveils correct, expected answers.
N[x[65]]
N[x[64.5]]
N[x[63]]
0.560737 0.67255 0.566941
Plot[soln, {t, 1, 100}, ImageSize -> Medium]
Another photo of the plot zoomed in with 0-100 and 1-100...
Is this a bug? Am I missing something? How can I trust the plot if it makes sudden bizarre mistakes like this?
I am running version 11.1.1 on MacOS sierra.
PlotPoints
. $\endgroup$