I am asked the following problem:

Find $f$ if $$f'(x)=\frac{x^2-1}{x}$$

I am not sure about my solution, which I will describe below:

My solution:

The first thing that I've done is separate the terms of $f'(x)$

\begin{align*} f'(x)&=\frac{x^2-1}{x}\\ &=x-\frac{1}{x}\\ \therefore \quad f(x)&=\frac{x^2}{2}-\ln|x|+c \end{align*}

For ( x > 0 ):

\begin{align*} f(x)&=\frac{x^2}{2}-\ln x+c\\ f(1)&=\frac{1^2}{2}-\ln 1+c=\frac{1}{2} \quad \Rightarrow \quad c=0\\ f(x)&=\frac{x^2}{2}-\ln |x| \end{align*}

For ( x < 0 )

\begin{align*} f(x)&=\frac{x^2}{2}-\ln (-x)+c\\ f(-1)&=\frac{(-1)^2}{2}-\ln [-(-1)]+c=0 \quad \Rightarrow \quad c=-\frac{1}{2}\\ f(x)&=\frac{x^2}{2}-\ln |x|-\frac{1}{2} \end{align*}

Is my solution correct? Should I really find two different answers, one for $x > 0$ and another for $x < 0$?

Thank you.

  • 3
    $\begingroup$ yes your solution is fine. As the domain has two connected components there can indeed be different constants of integration on each of them. $\endgroup$ – H. H. Rugh Sep 25 '16 at 17:03
  • 1
    $\begingroup$ It looks fine to me. +1 $\endgroup$ – DonAntonio Sep 25 '16 at 17:03
  • 1
    $\begingroup$ Related: math.stackexchange.com/questions/234624/… (see the accepted answer) $\endgroup$ – Winther Sep 26 '16 at 1:18

Looks fine! However a little typo when calculate $f(-1)=0$ not $-1$


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.