Value of $k$ such that $f(x) = kx$ has solutions

112 Views Asked by At

I have two functions $ f(x) = \exp(x^2)$ and $g(x) = kx$. I need to find values of $k > 0$ such that $f(x)=g(x)$ has solutions.

Here is what I did :

  • If $k < \exp(1)$, these two functions do not touch so there is no solution;

  • If $k = \exp(1)$, these functions touch only once, that is, $g$ is tangent to $f$ at some point. Denote the tangent point $x_0$, then $\exp(x_0^2) = kx_0 = \exp(1)x_0$. The slopes of the two functions have to be the same at this point as they are tangent:

    $f'(x_0) = g'(x_0) <=> 2x_0\exp(x_0^2) = \exp(1)$. And so $ \exp(x_0^2) = 2x_0^2\exp(x_0^2) <=> x_0 = 1\displaystyle /\sqrt(2)$;

  • If $ k > \exp(1)$, these two functions touch two times. I don't know how to pursue from there.

Thank you for your help.

3

There are 3 best solutions below

6
On BEST ANSWER

If $k=0$, there is no solution. If $k<0$, the equation can also be written as $$ \exp((-x)^2)=(-k)(-x) $$ so we can assume $k>0$ (the case $k<0$ is symmetric).

The solution to $\exp(x^2)=kx$, if it exists, is positive, so we can as well transform the problem into $x^2=\log k+\log x$.

Consider $h(x)=x^2-\log x-\log k$ (defined for $x>0$). We have $$ \lim_{x\to0}h(x)=\infty,\qquad \lim_{x\to\infty}h(x)=\infty $$ so $h$ has an absolute minimum. Now $$ h'(x)=2x-\frac{1}{x}=\frac{2x^2-1}{x} $$ only vanishes at $x=1/\sqrt{2}$. We have $$ h(1/\sqrt{2})=\frac{1}{2}+\frac{1}{2}\log2-\log k=\log\frac{\sqrt{2e}}{k} $$ The minimum is $\le0$ if and only if $$ \frac{\sqrt{2e}}{k}\le 1 $$ that is, $k\ge\sqrt{2e}$.

The final answer is thus, keeping into account the initial discussion, that the equation has

  • no solution if $|k|<\sqrt{2e}$;
  • one solution if $k=\pm\sqrt{2e}$;
  • two solutions if $|k|>\sqrt{2e}$.

Here is a graph for the three cases; the green function corresponds to the case $0<k<\sqrt{2e}$, the red one for $k=\sqrt{2e}$, the black one for $k>\sqrt{2e}$.

enter image description here

The same for $e^{x^2}-kx$:

enter image description here

2
On

Analytic solution

\begin{align} kx &= \exp(x^2) \quad (x > 0) \\ k^2 x^2 &= \exp(2x^2) \\ -k^2 x^2 &= -\exp(2x^2) \\ -2x^2 \exp(-2x^2) &= -2k^{-2} \\ -2x^2 &= W(-2k^{-2}) \end{align}

$W$ is the Lambert-$W$ function. Since $W(z)$ is multivalued when $z<0$, we need to pick the right branch.

  • when $x \le 1/\sqrt2$, $$x = \sqrt{-\frac{W_0(-2k^{-2})}{2}};$$
  • when $x \ge 1/\sqrt2$, $$x = \sqrt{-\frac{W_{-1}(-2k^{-2})}{2}}.$$

As $W$ is real-valued in this question, $-2k^{-2}$ has to be in the domain of $W$. $$\therefore -2k^{-2} \ge -\frac1e \iff k^2 \ge 2e \iff k > \sqrt{2e} \quad (k > 0)$$

Conclusion:

  • when $k < \sqrt{2e}$, there's no solution
  • when $k = \sqrt{2e}$, $-2k^{-2} = -e^{-1}$, so $W_0$ and $W_{-1}$ meets together, giving a unique solution $x = 1/\sqrt2$
  • when $k > \sqrt{2e}$, switching between branches $W_0$ and $W_{-1} $ gives different solutions, so there are two real roots.

Numerical verification (by Julia)

using LambertW

k = sqrt(2.0*e) + 2
x = sqrt(-lambertw(-2*k^(-2), -1)/2.0)
println("k = $(k), x = $(x)")
print("k*x = $(k*x), exp(x^2) = $(exp(x^2))")
# k = 4.331643981597124, x = 1.3206259878507927
# k*x = 5.720481612214643, exp(x^2) = 5.720481612214643

k = sqrt(2.0*e) + 2
x = sqrt(-lambertw(-2*k^(-2), 0)/2.0)
println("k = $(k), x = $(x)")
print("k*x = $(k*x), exp(x^2) = $(exp(x^2))")
# k = 4.331643981597124, x = 0.245160140326756
# k*x = 1.061946446373899, exp(x^2) = 1.061946446373899
0
On

Let's start with the 2 functions:$$f(x)=\exp(x^2)\\g(x)=kx$$ Notice that for $k>0,x\le 0$ $f(x)\ne g(x)$, so we left only with positive $x$.

Let's start with no solutions, if we have no solutions and $f(0)>g(0)$ it means that $f(x)>g(x)$ for all $x$(by the intermediate value theorem).

So we search for some $k$ such that $\exp(x^2)>kx$, this inequality is not something we can easily solve, so before solving it let's try to find relation between this case and between the case of one solution.

If we have one solution it means that at the solution the derivatives are also equal, before the solution the derivative of $g(x)$ need to be greater and after the solution the derivative of $f(x)$ need to be greater (it is also worth noting that both of the functions not decreasing for $x>0$).

So we search for $x_0$ such that $f(x_0)=g(x_0),f'(x_0)=g'(x_0), f'(x_1>x_0)>g'(x_1>x_0),f'(x_1<x_0)<g'(x_1<x_0)$, like you found in the post that $x_0=\frac1{\sqrt2}$(you have to check the other 2 conditions), using this we can find $k$:$$\exp(x_0^2)=kx_0\implies k=\sqrt{2\exp(1)}$$.

If we are decreasing $k$ we get $g(x)<\sqrt{2\exp(1)}x\le f(x)$ hence we have no solutions if $k<\sqrt{2\exp(1)}$.

Of we are increasing $k$ we have $g(x)>\sqrt{2\exp(1)}x\le f(x)$, and we have the spacial case of $x_0$: $$g(x_0)>\sqrt{2\exp(1)}x_0= f(x_0)$$.

We can show that if $k>\sqrt{2\exp(1)}$ we have exactly $2$ solutions by the fact that $g''(x)=0$


For negative $k$ we just ignore the positive $x$'s and do the exact same thing