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

Click For Summary
SUMMARY

The discussion focuses on finding the minimum value of the function f(x) = x² + |x - a| + 1 in terms of the variable a. The minimum occurs at different points based on the value of a: for a < -1/2, the minimum value is f(x) = 3/4 - a; for -1/2 ≤ a ≤ 1/2, the minimum value is f(x) = a² + 1; and for a > 1/2, the minimum value is f(x) = 3/4 + a. The participants emphasize the importance of considering the conditions x > a and x < a when determining the minimum.

PREREQUISITES
  • Understanding of quadratic functions and their properties
  • Familiarity with the modulus function and its behavior
  • Knowledge of calculus, particularly differentiation for finding local minima
  • Ability to analyze piecewise functions and their domains
NEXT STEPS
  • Study the properties of quadratic functions and their vertices
  • Learn about the behavior of absolute value functions and their impact on continuity and differentiability
  • Explore piecewise functions and how to analyze them in different intervals
  • Investigate optimization techniques for functions with constraints
USEFUL FOR

Mathematicians, students studying calculus, and anyone interested in optimization problems involving piecewise functions and absolute values.

songoku
Messages
2,509
Reaction score
393
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   Reactions: 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   Reactions: 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   Reactions: 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   Reactions: Delta2

Similar threads

Replies
21
Views
3K
  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 13 ·
Replies
13
Views
1K
  • · Replies 15 ·
Replies
15
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 11 ·
Replies
11
Views
4K
Replies
8
Views
4K
  • · Replies 19 ·
Replies
19
Views
3K