When I use the below script to solve an equation and plot the solution, the plot shows some discontinuous lines. For example at point $x\approx0.25$ the solver cannot find the answer and the plot is discontinuous. How can I fix this problem?
Clear["Global`*"]
c = -0.8;
L = 1;
b = Pi/L;
{x1, x2} = {0, L};
eqn = f[x] == c Sin[2 f[x]] + b x + Pi/2;
f[x_] = f[x] /.
DSolve[{D[eqn, x],
f[0] == (f0 /.
Solve[(eqn /. x -> 0 /. f[0] -> f0), f0, Reals][[1]])},
f[x], {x, x1, x2}][[1]] // FullSimplify
(*InverseFunction[-(1/2) Cos[2 #1]+#1&][(11 x)/10]*)
Plot[f[x], {x, x1, x2}]
f[0.1]=1.09728 -0.320829 I
. You can choose to plot the real part withRe[f[x]]
$\endgroup$