Find the area between y = 1 - x/π
and y = Sin[x]
.
Here is what I have typed in so far into Mathematica:
Clear[f, g, x]
f[x_] := 1 - x/π
g[x_] := Sin[x]
Plot[{f[x], g[x]}, {x, 0, 2 π},
PlotStyle -> {Red, Blue}, PlotRange -> {-1.2, 1.2}, Filling -> {1 -> {2}}]
The graph worked, so I have that. However, when I try to do the next step,
Solve[f[x] = g[x], x]
, it will not give me the intersects. I have even tried retyping the equations in: Solve[Sin[x] = 1 - x/π, x]
, but nothing is working. What am I doing wrong?
Pi
(not pi), and==
(not =). And try specifyingReals
forSolve
's domain. (Although that might not be the real problem.) And I wonder, section 6.1 of what? $\endgroup$Solve[f[x] == g[x], x, Reals]
. $\endgroup$NSolve
instead for a numerical solution. $\endgroup$Integrate[Abs[f[x] - g[x]], {x, 0, 2 Pi}] // N
$\endgroup$