# Intersection between an exponential function and a polynomial function

I am trying to see if the two graphs intersect each other or not. If they intersect, I want to know the points too. One is an exponential function in and the other is a polynomial function in two variables $$x$$ and $$y$$. I was using Solve to do the same before when both were polynomial functions. Now, Solve just returns the arguments.

Solve[4 + 0.2 Exp[-x] == (-0.38 x^2 -
x (0.05 (0.2 - 1.6 y) + 0.2 (-2.9 - 0.2 y)) -
0.8 y (0.15 - 0.2 y + 0.9 (-3 + 2 y)))/(0.2 x + 0.8 y) && x >= 0 &&
y >= 0, {x, y}]


Can you please guide me with this?

• Using subscripts is not a very good idea; why not just use x and y? Also, you are now solving a transcendental equation, and Solve[] is not very good at those. If you are plotting them anyway, have a look at MeshFunctions. Mar 31, 2019 at 0:00
• @J.M.isslightlypensive, thank you for the advice. I have renamed the variables. I will also look at MeshFunctions Mar 31, 2019 at 0:17
• The example here might be of use. Mar 31, 2019 at 0:21
• See if you can make use of Solve[4 + 0.2 Exp[-x] == (-0.38 x^2 - x (0.05 (0.2 - 1.6 y) + 0.2 (-2.9 - 0.2 y)) - 0.8 y (0.15 - 0.2 y + 0.9 (-3 + 2 y)))/(0.2 x + 0.8 y), {y}] Mar 31, 2019 at 13:28
• Yes, Solve[] is a bit cleaner here. NSolve[] replaces e^m with 2.71828^m.
– mjw
Mar 31, 2019 at 17:46

You can use Contourplot more directly to show the solutionrange of f1[x]==f2[x,y]

ContourPlot[f1[x] == f2[x, y] , {x, -c, c}, {y, -c, c} , FrameLabel -> {x, y}]


This contour equals the solution of NSolve[f1[x] == f2[x, y] , {x, y}]

• Yes, very nice! This clearly shows where the solution is! The place of discontinuity is where the denominator equals zero: p = ContourPlot[f1[x] == f2[x, y], {x, -c, c}, {y, -c, c}, FrameLabel -> {x, y}]; q = ContourPlot[.2 x + .8 y == 0, {x, -c, c}, {y, -c, c}, ContourStyle -> Red]; Show[p, q]
– mjw
Mar 31, 2019 at 17:49

I believe there is no solution when both $$x\ge 0$$ and $$y\ge0$$.

Here are some quick plots:

 c = 3;
f1[x_] = 4 + Exp[-x];
f2[x_, y_] = (-0.38 x^2 - x (0.05 (0.2 - 1.6 y) + 0.2 (-2.9 - 0.2 y))
- 0.8 y (0.15 - 0.2 y + 0.9 (-3 + 2 y)))/(0.2 x + 0.8 y);
ContourPlot[{f2[x, y]}, {x, 0, c}, {y, 0, c},
Contours -> 10, FrameLabel -> {x, y}]
Plot[f1[x], {x, 0, c}, AxesLabel -> {x, 4 + Exp[-x]}] At the innermost contour shown, $$f_2(x,y) = 2$$ and the value of $$f_2(x,y)$$ along the other contours decreases as $$x$$ and $$y$$ increase. The function $$f_1(x,y)=4+\exp(-x)$$ is bounded between $$4$$ and $$5$$ for $$x\ge0$$.

Also,

 f2[10^-30, 10^-30]


returns

2.61.

If you relax the conditions $$\{x\ge0,y\ge0\}$$, Mathematica will return solutions:

 NSolve[4. + 0.2 Exp[-x] == (-0.38 x^2
-x (0.05 (0.2 - 1.6 y) + 0.2 (-2.9 - 0.2 y))
-0.8 y (0.15 - 0.2 y + 0.9 (-3 + 2 y)))/(0.2 x + 0.8 y),
{x, y}]


does give a complicated expression for $$y$$ as a function of $$x$$.