# How to find the equation of a line tangent to a function

How it's possible to find the equation to a line tangent to a function in a point where the derivative of the function is an indeterminate form?
I'm analyzing this function: $$y = \frac{x^2}{1+\log|x|}$$ And the first derivative is: $$y\,' = \frac{x(1+2\log|x|)}{(1+\log|x|)^2}$$ I have to find the line tangent in $x = 0$.
..but I'm looking for a method applicable to all kind of real-valued functions of real variable (or at least for a wide range of this).

-
There is no "indeterminate form" in your example. –  André Nicolas Jul 4 '12 at 15:58
@AndréNicolas, Sorry, I forget to say in which point I have to find the tangent... –  Overflowh Jul 4 '12 at 16:12
The function isn't even defined for $x=0$, as it stands. It's easy enough to see that it has a limit of $0$ for $x\to 0$, and you're free to extend it in that way. But what you then have is a function defined by cases ($x=0$ versus $x\ne 0$), and then you can't just assume that the symbolic derivative that works inside the $x\ne 0$ case will work across the boundary to $x=0$. You'll need to go back to the definition of the derivative, or at least find a more potent shortcut than ordinary symbolic differentiation. –  Henning Makholm Jul 4 '12 at 16:23

Our function is undefined at $0$. However, it is clear that it approaches $0$ as $x$ approaches $0$. So we have a removable discontinuity at $x=0$. Remove it! Define our function to be $0$ at $x=0$.

Let our modified function be $f(x)$. We want to calculate $f'(0)$. Go back to the definition of derivative. Since $f(0)=0$, we want $$\lim_{h\to 0} \frac{h^2}{h(1+\log|h|)}.$$ This limit is easily seen to be $0$.

Remark: Since our original function is not defined at $0$, I think the proper conclusion is that the derivative does not exist at $0$. In principle, what we found is the derivative at $0$ of a different function. However, from the point of view of the geometry, there is really no problem at $0$.

-

Here, the domain of your function is $\Bbb R\smallsetminus\{-1/e,0,1/e\}$, and one can continuously extend that by explicitly stating that $y(0)=0$. It turns out, in fact, that this is a differentiable extension, as $$\lim_{x\to 0}\cfrac{\frac{x^2}{1+\log|x|}-0}{x}=\lim_{x\to 0}\frac{x}{1+\log|x|}=0,$$ since the numerator shrinks and the denominator grows (more negative) without bound. As a side note, explicitly stating that $y'(0)=0$ gives a continuous extension of $y'(x)=\frac{x(1+2\log|x|)}{(1+\log|x|)^2}$ (as you can check), so our derivative is also continuous on $\Bbb R\smallsetminus\{-1/e,1/e\}$.

Thus, at every point $x\in\Bbb R\smallsetminus\{-1/e,1/e\}$, there is a tangent line to the function $$y=\begin{cases}0 & x=0\\\frac{x^2}{1+\log|x|} & x\in\Bbb R\smallsetminus\{-1/e,0,1/e\}.\end{cases}$$ Of course, if you don't extend the function to be defined at $0$, then there's nothing to worry about, since you've got an explicit formula for the derivative at every point of the domain.

-

If your function is differentiable in x0, then the equation for the tangent is

$$y = a \cdot x + b$$

where

$$\begin{cases} a = f'(x_0) \\ b = f(x_0) - f'(x_0) \cdot x_0 \end{cases}$$

so that

$$y = f'(x_0) \cdot x + (f(x_0) - f'(x_0) \cdot x_0)$$

If f(x) isn't differentiable in x0 it may be left or right differentiable, and you have two tangents if it's both left and right differentiable.

-
Consider $y=\sqrt[3]{x}$. This isn't differentiable at $x=0$, but does have tangent line $x=0$. –  Cameron Buie Jul 4 '12 at 15:58
The function is defined for $x<0$ (it's the cube root, not the square root). Functions can (though need not) still have a tangent line at a point of non-differentiability, but such a line will not be of the form $y-y_0=m(x-x_0)$. Every line in the plane can be written in the form $Ax+By+C=0$, but vertical lines cannot be written in point-slope or slope-intercept form. –  Cameron Buie Jul 4 '12 at 16:27
It is not differentiable, there, true, but it does have $x=0$ as a tangent line. To visualize it, what is the tangent line to $y=x^3$ at $0$? It is $y=0$. Now reflect everything over the line $y=x$. –  Cameron Buie Jul 4 '12 at 17:41