I'm trying to plot the function $f(x)=\dfrac{1}{x^2}$, filling the square area from (0,0) to (1,1) with purple and filling the area under the curve from 1 to 4 with red.
However, Mathematica is not showing the purple filling, and the red part is not completely filled down to the x-axis.
My current code:
Show[Plot[1/(x^2), {x, 0, 4}, PlotStyle -> Blue, AspectRatio -> 1],
Plot[{1/(x^2), 1}, {x, 0, 1}, PlotStyle -> Blue, Filling -> {1 -> {{2}, {Purple, None}}}],
Plot[1/(x^2), {x, 1, 4}, PlotStyle -> Blue, Filling -> Axis, FillingStyle -> Red]]
What Mathematica gives me:
What's wrong with my code?
(I'm also very new to Mathematica, so any suggestions on a more elegant way to fill the curve would be appreciated.)