Find minimum value of f(x) in terms of variable a

AI Thread Summary
The discussion centers on finding the minimum value of the function f(x) = x^2 + |x-a| + 1 in terms of the variable a. For x > a, the minimum occurs at x = -1/2, yielding f(x) = 3/4 - a if a < -1/2, while for a ≥ -1/2, the minimum is at x = a, resulting in f(x) = a^2 + 1. For x < a, the minimum occurs at x = 1/2, giving f(x) = 3/4 + a for a > 1/2, and again at x = a for a ≤ 1/2, leading to f(x) = a^2 + 1. The key point is that the minimum values change based on the intervals of a, specifically for a < -1/2, -1/2 ≤ a ≤ 1/2, and a > 1/2. The final consensus is that the minimum value is correctly identified for each case, with the understanding that x = a is not differentiable at that point.
songoku
Messages
2,467
Reaction score
382
Homework Statement
For ##f(x)=x^2+|x-a|+1, x ~\text{and} ~a \in \mathbb{R} ##, find minimum value of ##f(x)## in terms of ##a##
Relevant Equations
Modulus Function
(1) For ##x>a##
##f(x)=x^2+x-a+1 \rightarrow## minimum value obtained when ##x=-\frac{1}{2}##

Minimum value of ##f(x)=\frac{3}{4} -a##

(2) For ##x<a##
##f(x)=x^2-x+a+1 \rightarrow## minimum value obtained when ##x=\frac{1}{2}##

Minimum value of ##f(x)=\frac{3}{4}+a##

But the teacher said there is missing solution (my final answer is not complete yet). I don't understand which one it is

Thanks
 
Physics news on Phys.org
x = a, perhaps?
 
  • Like
Likes ehild
what happens in case 1) if ##a>-\frac{1}{2}## ? Remember that you found the minimum at ##x=-\frac{1}{2}## but you also impose the condition ##x>a##.
What happens in case 2) if ##a<\frac{1}{2}##?
 
Last edited:
  • Like
Likes ehild
songoku said:
Homework Statement:: For ##f(x)=x^2+|x-a|+1, x ~\text{and} ~a \in \mathbb{R} ##, find minimum value of ##f(x)## in terms of ##a##
Relevant Equations:: Modulus Function

But the teacher said there is missing solution
More to the point, you have not answered the question. The form of the answer should be "when a is range ... the min is at x= ...; when a is in range... " etc.
Starting the answer with "for x<a ..." doesn't work because the reader can't yet know if that is true.
 
DaveE said:
x = a, perhaps?
At ##x=a##, the value of ##|x-a|=0## so ##f(x)=a^2+1## . Is this what you mean?

Delta2 said:
what happens in case 1) if ##a>-\frac{1}{2}## ? Remember that you found the minimum at ##x=-\frac{1}{2}## but you also impose the condition ##x>a##.
What happens in case 2) if ##a<\frac{1}{2}##?

haruspex said:
More to the point, you have not answered the question. The form of the answer should be "when a is range ... the min is at x= ...; when a is in range... " etc.
Starting the answer with "for x<a ..." doesn't work because the reader can't yet know if that is true.

I am not sure how to proceed.

(1) For ##x>a \rightarrow## the minimum will occur at ##x=-\frac{1}{2}##

This means that for ##a<-\frac{1}{2}##, the minimum value will be ##f(x)=\frac{3}{4} -a##

If ##a>-\frac{1}{2}##, there will be no solution because it contradicts with ##x>a## ?

(2) So for ##a>\frac{1}{2}## , the minimum value will be ##f(x)=\frac{3}{4}+a##

What I am missing is solution for ##-\frac{1}{2} \leq a \leq \frac{1}{2}## ? If yes, how to find this? How to simplify ##|x-a|## besides separating it to ##x>a## and ##x<a##?

Thanks
 
songoku said:
If a>−12, there will be no solution because it contradicts with x>a ?
I think that statement is wrong, i think there will still be solution when ##x>a## and ##a>-\frac{1}{2}##, think about it. Study the monotonicity of the function in the intervals ##[-\frac{1}{2},a], [a,+\infty)## and always consider that we have ##x>a##.
Similarly for 2nd case of ##x<a## study the monotonicity in the proper intervals.
 
songoku said:
At ##x=a##, the value of ##|x-a|=0## so ##f(x)=a^2+1## . Is this what you mean?I am not sure how to proceed.

(1) For ##x>a \rightarrow## the minimum will occur at ##x=-\frac{1}{2}##

This means that for ##a<-\frac{1}{2}##, the minimum value will be ##f(x)=\frac{3}{4} -a##

If ##a>-\frac{1}{2}##, there will be no solution because it contradicts with ##x>a## ?

(2) So for ##a>\frac{1}{2}## , the minimum value will be ##f(x)=\frac{3}{4}+a##

What I am missing is solution for ##-\frac{1}{2} \leq a \leq \frac{1}{2}## ? If yes, how to find this? How to simplify ##|x-a|## besides separating it to ##x>a## and ##x<a##?

Thanks
Remember that differentiation finds local minima of differentiable functions. E.g. it won't find the minimum of |x|. Try sketching f for a=1/4.
 
Last edited:
Delta2 said:
I think that statement is wrong, i think there will still be solution when ##x>a## and ##a>-\frac{1}{2}##, think about it. Study the monotonicity of the function in the intervals ##[-\frac{1}{2},a], [a,+\infty)## and always consider that we have ##x>a##.
Similarly for 2nd case of ##x<a## study the monotonicity in the proper intervals.
haruspex said:
Remember that differentiation finds local minima of differentiable functions. E.g. it won't find the minimum of |x|. Try sketching f for a=1/4.

I think I understand.

(1) For ##x>a \rightarrow f(x)=x^2+x-a+1## and the vertex will be at ##x=-\frac{1}{2}##
(i) If ##a \geq -\frac{1}{2}## , the minimum value will be at ##x=a## so minimum value is ##f(x)=a^2 + 1##
(ii) If ##a<-\frac{1}{2}##, the minimum value will be at ##x=-\frac{1}{2}## so minimum value is ##f(x)=\frac{3}{4}-a##

(2) For ##x<a \rightarrow f(x)=x^2-x+a+1## and the vertex will be at ##x=\frac{1}{2}##
(i) If ##a>\frac{1}{2}##, the minimum value will be at ##x=\frac{1}{2}## so the minimum value is ##f(x)=\frac{3}{4}+a##
(ii) If ##a\leq \frac{1}{2}##, the minimum value will be at ##x=a## so the minimum value is ##f(x)=a^2+1##

Intersecting (1) and (2), I get:

For ##a < -\frac{1}{2} \rightarrow##, the minimum value is ##\frac{3}{4}-a##
For ##-\frac{1}{2} \leq a \leq \frac{1}{2}##, the minimum value is ##a^2+1##
For ##a > \frac{1}{2}##, the minimum value is ##\frac{3}{4}+a##

Am I correct? Thanks
 
Last edited:
I think you are right for (1) and (2) but i am not sure in the recombination (intersection of (1) and (2) as you say).
 
  • #10
songoku said:
I think I understand.

(1) For ##x>a \rightarrow f(x)=x^2+x-a+1## and the vertex will be at ##x=-\frac{1}{2}##
(i) If ##a \geq -\frac{1}{2}## , the minimum value will be at ##x=a## so minimum value is ##f(x)=a^2 + 1##
(ii) If ##a<-\frac{1}{2}##, the minimum value will be at ##x=-\frac{1}{2}## so minimum value is ##f(x)=\frac{3}{4}-a##

(2) For ##x<a \rightarrow f(x)=x^2-x+a+1## and the vertex will be at ##x=\frac{1}{2}##
(i) If ##a>\frac{1}{2}##, the minimum value will be at ##x=\frac{1}{2}## so the minimum value is ##f(x)=\frac{3}{4}+a##
(ii) If ##a\leq \frac{1}{2}##, the minimum value will be at ##x=a## so the minimum value is ##f(x)=a^2+1##

Intersecting (1) and (2), I get:

For ##a < -\frac{1}{2} \rightarrow##, the minimum value is ##\frac{3}{4}-a##
For ##-\frac{1}{2} \leq a \leq \frac{1}{2}##, the minimum value is ##a^2+1##
For ##a > \frac{1}{2}##, the minimum value is ##\frac{3}{4}+a##

Am I correct? Thanks
If local extremum does not exixst inside the domain of the function, you find the absolute extremum on the boubdary. Now you have two separate functions, with domains x<a and x>a) x≤a and x≥a . There are local minima when a<-1/2 and a>1/2. In case -1/2<a<1/2 there is no local minimum in the domain, and the minimal value is on the boundary, x=a, and it is ##a^2+1##, as you stated.
 
Last edited:
  • #11
songoku said:
At x=a, the value of |x−a|=0 so f(x)=a2+1 . Is this what you mean?
I just meant that x=a wasn't included in your domain, that is all. You said x<a & x>a...
 
  • #12
DaveE said:
I just meant that x=a wasn't included in your domain, that is all. You said x<a & x>a...
Yes, thank you, I should have written x≤a and x≥a.
 
  • #13
To get an intuitive grasp of the problem, note that the graph of |x-a| is a V shape with a 45 degree slope each side. So where the magnitude of the slope of x2 is less than 45 degrees, that V still leads to a local minimum of f at x=a. Where the quadratic term's slope is greater, one side of the V will 'yield', removing that local minimum.
 
Last edited:
  • #14
Delta2 said:
I think you are right for (1) and (2) but i am not sure in the recombination (intersection of (1) and (2) as you say).
I am not sure what my mistake is. Can you tell me which part of the recombination is wrong? Or maybe all are wrong?

ehild said:
If local extremum does not exixst inside the domain of the function, you find the absolute extremum on the boubdary. Now you have two separate functions, with domains x<a and x>a) x≤a and x≥a . There are local minima when a<-1/2 and a>1/2. In case -1/2<a<1/2 there is no local minimum in the domain, and the minimal value is on the boundary, x=a, and it is ##a^2+1##, as you stated.
So is my answer correct? Or I am missing something?

haruspex said:
To get an intuitive grasp of the problem, note that the graph of |x-a| is a V shape with a 45 degree slope each side. So where the magnitude of the slope of x2 is less than 45 degrees, that V still leads to a local minimum of f at x=a. Where the quadratic term's slope is greater, one side of the V will 'yield', removing that local minimum.
I can still follow until "the graph of |x-a| is a V shape with a 45 degree slope each side". but I don't understand the rest. Why when the magnitude of the slope of x2 is less than 45 degrees V still leads to a local minimum of f at x=a?

Thanks
 
  • #15
songoku said:
Why when the magnitude of the slope of x2 is less than 45 degrees V still leads to a local minimum of f at x=a?
The gradient of the sum of two functions, (f+g)', is the sum of the gradients, f'+g'.
Where the slope of x2 is less than 45 degrees, its gradient has magnitude less than 1. The V formed by |x-a| has gradient -1 on the left and gradient +1 on the right. Adding the two leaves both sides of the V still pointing upwards away from x=a, though one side may be steeper now and the other side correspondingly less so.
Where the gradient of x2 has magnitude greater than 1, adding it to |x-a|will push one side of the V down so far that the sign of the gradient is the same both sides of x=a.
 
  • #16
@songoku ,
What method are you using to find the minimum? Are you differentiating, or are you using the location of the vertex of a parabola? ... or using some other method?
 
  • #17
haruspex said:
The gradient of the sum of two functions, (f+g)', is the sum of the gradients, f'+g'.
Where the slope of x2 is less than 45 degrees, its gradient has magnitude less than 1. The V formed by |x-a| has gradient -1 on the left and gradient +1 on the right. Adding the two leaves both sides of the V still pointing upwards away from x=a, though one side may be steeper now and the other side correspondingly less so.
Where the gradient of x2 has magnitude greater than 1, adding it to |x-a|will push one side of the V down so far that the sign of the gradient is the same both sides of x=a.
I will read it repeatedly to understand this

SammyS said:
@songoku ,
What method are you using to find the minimum? Are you differentiating, or are you using the location of the vertex of a parabola? ... or using some other method?
I am using the location of vertex of a parabola by using formula ##x=-\frac{b}{2a}##

So I think my answer is still wrong?

Thanks
 
  • #18
songoku said:
So I think my answer is still wrong?
Your answer in post #8 is correct.
 
  • #19
songoku said:
So is my answer correct? Or I am missing something?I can still follow until "the graph of |x-a| is a V shape with a 45 degree slope each side". but I don't understand the rest. Why when the magnitude of the slope of x2 is less than 45 degrees V still leads to a local minimum of f at x=a?

Thanks
You gave the minimum value of the function correctly, but you can not get x=a for the position of minimum by differentiazing the function : it is not differentiable at x=a.
"The absolute value function is continuous, but fails to be differentiable at x = 0 since the tangent slopes do not approach the same value from the left as they do from the right. Wikipedia"
I do not follow what you mean on "intersecting" the results for x<a abd x>a.
 
  • Like
Likes Delta2
  • #20
ehild said:
You gave the minimum value of the function correctly, but you can not get x=a for the position of minimum by differentiazing the function : it is not differentiable at x=a.
"The absolute value function is continuous, but fails to be differentiable at x = 0 since the tangent slopes do not approach the same value from the left as they do from the right. Wikipedia"

I understand. For minimum at ##x=a##, I just use substitution, putting ##x=a## to ##f(x)##

I do not follow what you mean on "intersecting" the results for x<a abd x>a.

I am not sure how to say it, maybe I should say that I use union rather intersection. I tried to find overlapping region that has minimum value of ##a^2+1## and I get interval ##-\frac{1}{2} \leq a \leq \frac{1}{2}##
 
Last edited:
  • #21
songoku said:
I am not sure how to say it, maybe I should say that I use union rather intersection. I tried to find overlapping region that has minimum value of ##a^2+1## and I get interval ##-\frac{1}{2} \leq a \leq \frac{1}{2}##
Very intuitive! So you did not differentiated ar all, and you guessed that the function has minimum where |x-a| does, that is at x=a for some a values. and found that intervall of a where that happens.
 
  • #22
ehild said:
Very intuitive! So you did not differentiated ar all, and you guessed that the function has minimum where |x-a| does, that is at x=a for some a values. and found that intervall of a where that happens.
Yes, I do not use differentiation at all, just trying to understand and follow all the hints given here.

Thank very much for all the help and explanation DaveE, Delta2, haruspex, ehild, SammyS
 
  • Like
Likes Delta2
Back
Top