# coding style – Question on Heron’s formula or any other way to solve this question

``````    f(x_) := x^3;
df(x_) = f'(x);

tan(x_, x0_) := f(x0) + df(x0) (x - x0)
With({x0 = 1.2}, NSolve(tan(x, x0) == f(x), x))
With({x1 = -2.4}, NSolve(tan(x, x1) == f(x), x))

Module({x, pts, names, offsets, ptlbls, arealbls},
x(0) = 1.2; x(1) = -2.4; x(2) = 4.8;
pts = {{x(0), f(x(0))}, {x(1), f(x(1))}, {x(2), f(x(2))}};
names = {"Fun1", "Fun2", "Fun3"};
offsets = {{10, -10}, {10, -10}, {-15, 3}};
ptlbls = MapThread(Text(#1, Offset(#2, #3)) &, {names, offsets, pts});
arealbls = {
Text("A", Offset({-20, 2}, (pts((1)) + pts((2)))/2)),
Text("B", Offset({0, -35}, (pts((2)) + pts((3)))/2))};
Plot(Evaluate@{f(x), tan(x, x(0)), tan(x, x(1))}, {x, -3, 5},
Epilog -> {ptlbls, {Red, AbsolutePointSize(5), Point(pts)}, arealbls}))```
``````

How can I find the area for B? Its between fun 2 and fun 3. Do I neeed to usee Heron’s formula? if so, how?

Can someone explain it to me so I understand how you got it? Or just tell me what to do?