# How can I make a general plot like this in Mathematica?

I want to make two general graphics something like the following. I want to illustrate the approach to the function by means of a polynomial. I have tried the following.

Plot[{Sin[x] + 2,  Sin[2 x] + 2}, {x, 0, 8}, AxesLabel -> {x, y},
Ticks -> {{0.8, 2.4, 4, 5.5, 7.1}, {0, 1, 2, 3}}]


I also want to put $$x_{0}, x_{1}, x_{2},...,x_{n}$$ in the points where the graphs differ the most. I appreciate any help.

f[x_] := 1 + x + Sin[10 Sqrt[1 + x]];
g[x_] := 1 + x + Cos[10 Sqrt[2 + x]];
xx = x /. NSolve[{f'[x] == g'[x], 0 <= x <= 8}, x];
ticks = MapIndexed[{#, Style[ Subscript["x", ToString@ #2[]],  16]} &, xx];
Plot[{f[x], g[x]}, {x, 0, 3 Pi}, AxesLabel -> {x, y},
MeshFunctions -> {f'[#] - g'[#] &}, Mesh -> {{0}},
MeshStyle -> Directive[Red, PointSize[Large]],
GridLines -> {xx, None}, Ticks -> {ticks, Automatic},
AxesOrigin -> {0, 0}] • How could you put $x_{0}, x_{1}, ..., x_{6}$ instead $x_{1}, x_{2}, ..., x_{7}$? – Jacob Schwartz Feb 5 '19 at 8:10
• @JacobSchwartz, replace ToString@#2[]  with ToString[#2[] - 1]. – kglr Feb 5 '19 at 8:19

Something like this?

    Plot[{Sin[x] + 2, Sin[2 x] + 2}, {x, 0, 8}, AxesLabel -> {x, y},
Ticks -> {{{1, "x"}, {2, "x"}, {3, ""}, {4, "x"}, {5,
""}, {6, ""}, {7, "x[n]"}}, None},
PlotLabels -> Placed[{"y=f(x)", "y=p(x)"}, {Scaled, Above}], Or

Plot[{Sin[x] + 2, Sin[2 x] + 2}, {x, 0, 8}, AxesLabel -> {x, y},
Ticks -> {{{1, "x"}, {2, "x"}, {3, ""}, {4, "x"}, {5,
""}, {6, ""}, {7, "x[n]"}}, None}, 