I'm trying to solve some a problem relating to absolute values. I found online the strategy for solving similar functions from here: https://www.youtube.com/watch?v=eIHtq67nh7w&list=PLGbL7EvScmU7DfRNwONW7JDDcmB98Gjcs&index=22&t=305s&ab_channel=ProfRobBob
Using the strategy shown:
$y = |2x-3|+1$ solve for $0$, to find where break point in the line will be: $0 = 2x-3 -> x = 3/2$
By substituting values around the break point, for example:
When: $x=0 $
$y = |2(0) -3| + 1 $
$y = |-3| + 1 $
$y = 4$
(absolute value needs to be taken when x < 3/2)
When: $x=3 $
$y = |2(3) -3| +1 $
$y = |3| + 1 $
$y = 4$
(The result is the same regardless of taking the absolute value when x> 3/2)
We can then represent the first equation to make it piecewise:
$y = 2x - 3 + 1 ; x >= 3/2$
$y = -2x + 3 + 1 ; x < 3/2$
derivatives would be:
$y = 2; x >=3/2 $
$y =-2; x < 3/2$
HOWEVER, I am trying to solve a function like this:
$y = |x^2 - 3| + |x + 1|$
And Im not sure how to go about it. I tried doing the same as before:
$0 = x^2 -1 + x + 4 -> -3 = x^2 +x$
But this doesn't seem like the right approach, any advice on what to do?
You have $3$ points of interest $\pm\sqrt{3}$ and $-1$.
So let just examine what does $f$ looks like in the intervals considered.
$\begin{array}{lll} (-\infty,-\sqrt{3}] & f(x)=(x^2-3)-(x+1)=x^2-x-4 & f'(x)=2x-1\\ [-\sqrt{3},-1] & f(x)=-(x^2-3)-(x+1)=-x^2-x+2 & f'(x)=-2x-1\\ [-1,\sqrt{3}] & f(x)=-(x^2-3)+(x+1)=-x^2+x+4 & f'(x)=-2x+1\\ [\sqrt{3},+\infty) & f(x)=(x^2-3)+(x+1)=x^2+x-2 & f'(x)=2x+1\\ \end{array}$
I'll let you calculate all $6$ values $f'(\pm\sqrt{3})$ and $f'(-1)$.
($3$ points of interest times $2$ intervals per point = $6$ values)
You can also set $f(x)=a(x^2-3)+b(x+1)=ax^2+bx+(b-3a)$
So that $f'(x)=2ax+b$ with $a,b=\pm 1$ the respective signs of expressions inside the absolute values.