# What does it mean to extend a function?

What does it mean to extend a function? Can someone please give an example?

• To "extend $f$", means to define a function $g$, whose domain contains the domain of $f$, such that $g(x)=f(x)$ for all $x$ in the domain of $f$. – David Mitra Feb 1 '15 at 22:22
A good example might be $\sqrt{x}$. We cannot put a negative $x$ in a square root if we only care about real numbers. But, we can define a function $\sqrt{|x|}$. If $x\geq 0$ this is the same function as before since, in this case, $|x|=x$. But, the function can now take in negative numbers.
• In your example, if we take $g(x) = \sqrt{x}$, if $x \geq 0$ and $g(x) = x^2$, if $x < 0$. So we could to say that $g$ is an extension of $f: [0,\infty) \rightarrow \mathbb{R}$ defined by $f(x) = \sqrt{x}$? – Thiago Alexandre Mar 29 at 22:59