问题描述
我已经定义了两个函数:
jest.mock('./AutoSuggest');
f[x_] := 40*1.04^x
然后我在绘制它们:
g[x_] := 150*0.9^x
但是如何显示这两个函数的交集?
解决方法
f[x_] := 40*1.04^x
g[x_] := 150*0.9^x
sol = Quiet[Solve[f[x] == g[x],x]];
xpts = x /. sol;
ypts = f /@ xpts;
Plot[{f[x],g[x]},{x,20},Epilog -> {PointSize[0.02],Orange,Map[Point,Transpose[{xpts,ypts}]]}]