How do I combine these two functions that both have restrictions into a single equation? $$f(x)=|x|\times\frac{\sqrt{x^2-1}}{\sqrt{x^2-1}}$$ and $$g(x)=-|x|\times\frac{\sqrt{1-x^2}}{\sqrt{1-x^2}}$$
-
$\begingroup$ Just see their domains, you can easily define a piecewise function. $\endgroup$– SomeoneMay 8, 2015 at 16:57
-
$\begingroup$ I am looking for a equation that combines both of them but in a single equation. $\endgroup$– GamrCorpsMay 8, 2015 at 16:59
2 Answers
How about the following? $$h(x)=\frac{x^2-1}{|x^2-1|}\cdot|x|\cdot\frac{\sqrt{|x^2-1|}}{\sqrt{|x^2-1|}}$$
If $x^2-1\gt 0$, then $$h(x)=\frac{x^2-1}{x^2-1}\cdot|x|\cdot\frac{\sqrt{x^2-1}}{\sqrt{x^2-1}}=f(x).$$ Note that $f(x)$ is defined only when $x^2-1\gt 0$.
If $x^2-1\lt 0$, then $$h(x)=\frac{x^2-1}{-(x^2-1)}\cdot|x|\cdot\frac{\sqrt{1-x^2}}{\sqrt{1-x^2}}=g(x).$$ Note that $g(x)$ is defined only when $x^2-1\lt 0$.
Added : As a user Mann points out, $$\frac{x^2-1}{|x^2-1|}\cdot|x|$$ should work.
-
$\begingroup$ I think only $\frac{x^2-1}{|x^2-1|}*|x|$ does the work. $\endgroup$– SomeoneMay 8, 2015 at 17:09
-
-
$\begingroup$ @Mann: Ah, you mean that I don't need $\frac{\sqrt{x^2-1}}{\sqrt{x^2-1}}$ part. I think you are right. Thank you for pointing it out. $\endgroup$– mathloveMay 8, 2015 at 17:31
-
$\begingroup$ Is there a way to combine 4+ different functions, also in this fashion? $\endgroup$ May 8, 2015 at 19:25
-
$\begingroup$ @IonLee: Well, it depends. Can you give a concrete example? (I think if you have another question, it's better for you to ask it as a new question :) $\endgroup$– mathloveMay 8, 2015 at 19:28
What about $$h(x)= \begin{cases} g(x) & \textrm{for }|x|<1 \\ 0 & \textrm{for }|x|=1 \\ f(x) & \textrm{for }|x|>1\\ \end{cases}$$ assuming you want the function to be zero if $x=\pm 1$. (If you don't want that, omit the second case.)