Value of functions with restricted range

M.bara

New member
Joined
Apr 30, 2020
Messages
8
Given the function as
z = x cos(a) +y sin(a)

I want to figure out the range value of z represented by x,y like z= [f(x,y),f(x,y)] while given a =[-pi/2,pi/2] . Note that, z only takes real value.

Please give me some hints. Thank you very much. I am very appreciated any helps.

I have tried to transform z to the form: z = R cos(a - b) where tan (b) = y/x. However the values of R and b are dependent so I could not figure out the range for z.
 
[MATH]z = x \cos(a) + y \sin(a)\\ z = \sqrt{x^2 + y^2} \cos\left(a - \tan^{-1}(x,y)\right)\\ \text{where $\tan^{-1}(x,y)$ is the arctangent function that properly accounts for quadrant}[/MATH]
 
I'm not quite sure what your goal is. Are you thinking of a as a parameter (fixed value for a given function), so that z is a function of x and y? Your saying "z= [f(x,y),f(x,y)]" looks like you are thinking of x and y as fixed, and a as the argument, so that the set of possible values of x as a varies depends on x and y. I'll take it as the latter.

The phase shift (your b) will determine whether the max or the min of the cosine function (your R) is within the restricted domain; the other extremum will be at an endpoint of the domain, which covers half a cycle. At least if I'm visualizing correctly ...
 
I'm not quite sure what your goal is. Are you thinking of a as a parameter (fixed value for a given function), so that z is a function of x and y? Your saying "z= [f(x,y),f(x,y)]" looks like you are thinking of x and y as fixed, and a as the argument, so that the set of possible values of x as a varies depends on x and y. I'll take it as the latter.

The phase shift (your b) will determine whether the max or the min of the cosine function (your R) is within the restricted domain; the other extremum will be at an endpoint of the domain, which covers half a cycle. At least if I'm visualizing correctly ...

Yes I want to figure out the range value of z depends on x,y while we change the parameter a (which covers half a circle), e.g., if a from -pi/2 to pi/2, the value of z will be from (x-y) to (x+y), something like that. However, as you can see, the value of the cos function depends on b, and make its value is not from -1 to 1 anymore.

Furthermore, the dependence between R and b also complicated the process. I try several ways to do it but to no avail.
 
Try picking some specific numbers as an example, and graph z as a function of a. Show me what you find, and we can discuss how the range is determined by x and y.
 
Try picking some specific numbers as an example, and graph z as a function of a. Show me what you find, and we can discuss how the range is determined by x and y.
As we can see that given any specific number of x and y, z can be determined as: z = R cos(a - b) where R = sqrt(x^2 + y^2) and tan(b) = y/x
For example, if x = y =1, z will be :
z = cos(a) + sin(a) = sqrt(2)cos(a - pi/4).
Since a varied from -pi/2 to pi/2, the value of z will be from -1 to sqrt(2)/2

From that one, I tried several cases for x and y as:
- x > 0, y>0: max(z) = R and min(z) = -y
- x > 0, y<0: max(z) = R and min(z) = y
- x < 0, y>0: max(z) = y and min(z) = -R
- x < 0, y<0: max(z) = -y and min(z) = -R

The results showed some similar patterns, but I am confused on explaining the patterns.
 
You misstated the maximum, but you have the right basic idea.

Here is a graph of z vs a, for x=y=1:

FMH122114.png

As x and y change, as you know, the graph will simultaneously change in amplitutde, and slide horizontally. The latter will determine where the max and min are; the former will determine what to multiply by. In this case (and for what other values of x, y?) the max is at the shift (your b), and its value is the amplitude R. The minimum is at the left and of the domain, which can be calculated. In other cases, the minimum will be equal to the amplitude and the maximum will be at an endpoint. This is the reason behind the pattern you identify; does that help you explain it?

The most interesting bit is that the minimum in this case is y. Can you see how to prove that in this particular example, and then use that thinking in the more general case?
 
You misstated the maximum, but you have the right basic idea.

Here is a graph of z vs a, for x=y=1:

View attachment 18403

As x and y change, as you know, the graph will simultaneously change in amplitutde, and slide horizontally. The latter will determine where the max and min are; the former will determine what to multiply by. In this case (and for what other values of x, y?) the max is at the shift (your b), and its value is the amplitude R. The minimum is at the left and of the domain, which can be calculated. In other cases, the minimum will be equal to the amplitude and the maximum will be at an endpoint. This is the reason behind the pattern you identify; does that help you explain it?

The most interesting bit is that the minimum in this case is y. Can you see how to prove that in this particular example, and then use that thinking in the more general case?

Thank you very much for your patience. I am a little slow in this kind of things so I apologized beforehand.

Since z = Rcos(a -b), where R can be positive or negative.

the value of b will determined what to multiply, in other words, the value of cos(a-b). Since a go from -pi/2 to pi/2, the value of cos(a-b) will go from -sin(b) to sin(b) and vice versa. However, as the distance between two limit point is pi, the graph will go over at least one point 0 or pi, where the value of cos is 1 or -1 (may be both of them in the special case of b = pi/2). The value of x and y will decide which point will be crossed.

By this logic, we can see, in the case R>0, the maximum value in any case will be R = sqrt(x^2 + y^2) while the minimum will be R*(-sin(b)) where sin(b) = y/R. For the case R<0, the values will be reversed.

However, I could not deduce the general case for any value of R. And what is the relation of the positive or negative R with x,y?

Since if we consider the function Rcos(a -b), mostly they only consider the case R > 0. Or else we have to consider the form xcos(a) + ysin(a) instead of Rcos(a -b).

Please give me some comments about it. Thank you again.
 
Last edited:
I have another answer for this question

We first have z = xcos(a) + ysin(a)

The first derivative of z will be z' = -xsin(a) + ycos(a) = cos(a+b), where sin(b) = x/sqrt(x^2+y^2) and cos(b) = y/sqrt(x^2+y^2). Let R = sqrt(x^2+y^2).

We then consider the first derivative: z' = 0 => a + b = pi/2 or a + b = -pi/2.

For the second derivative z" = -xcos(a) -ysin(a) = -Rsin(a+b). From this one we have the point (a+b) = pi/2 is the maximum and the point (a+b) = -pi/2 is the minimum point.

However, since a varies from -pi/2 to pi/2, we have several cases as
- b = 0, the maximum and minimum point remain the same, and max = R and min = -R
- b > 0, the maximal point remains the same but the minimum point is the left point, and max = Rsin(pi/2), min = -Rcos(b)
- b < 0, the minimal point remains the same but the maximum point is the right point, and max = Rcos(b) and min = Rsin(-pi/2).

However, if we do it like this, we still need to divide the cases. Is there any form for general case?

Please check this answer and give me some comments. Thank you very much.
 
Thank you very much for your patience. I am a little slow in this kind of things so I apologized beforehand.

Since z = Rcos(a -b), where R can be positive or negative.

the value of b will determined what to multiply, in other words, the value of cos(a-b). Since a go from -pi/2 to pi/2, the value of cos(a-b) will go from -sin(b) to sin(b) and vice versa. However, as the distance between two limit point is pi, the graph will go over at least one point 0 or pi, where the value of cos is 1 or -1 (may be both of them in the special case of b = pi/2). The value of x and y will decide which point will be crossed.

By this logic, we can see, in the case R>0, the maximum value in any case will be R = sqrt(x^2 + y^2) while the minimum will be R*(-sin(b)) where sin(b) = y/R. For the case R<0, the values will be reversed.

However, I could not deduce the general case for any value of R. And what is the relation of the positive or negative R with x,y?

Since if we consider the function Rcos(a -b), mostly they only consider the case R > 0. Or else we have to consider the form xcos(a) + ysin(a) instead of Rcos(a -b).

Please give me some comments about it. Thank you again.
Why would you allow R to be positive or negative? Don't. (You didn't in post #6.)
 
I have another answer for this question

We first have z = xcos(a) + ysin(a)

The first derivative of z will be z' = -xsin(a) + ycos(a) = cos(a+b), where sin(b) = x/sqrt(x^2+y^2) and cos(b) = y/sqrt(x^2+y^2). Let R = sqrt(x^2+y^2).

We then consider the first derivative: z' = 0 => a + b = pi/2 or a + b = -pi/2.

For the second derivative z" = -xcos(a) -ysin(a) = -Rsin(a+b). From this one we have the point (a+b) = pi/2 is the maximum and the point (a+b) = -pi/2 is the minimum point.

However, since a varies from -pi/2 to pi/2, we have several cases as
- b = 0, the maximum and minimum point remain the same, and max = R and min = -R
- b > 0, the maximal point remains the same but the minimum point is the left point, and max = Rsin(pi/2), min = -Rcos(b)
- b < 0, the minimal point remains the same but the maximum point is the right point, and max = Rcos(b) and min = Rsin(-pi/2).

However, if we do it like this, we still need to divide the cases. Is there any form for general case?

Please check this answer and give me some comments. Thank you very much.
I haven't been considering calculus, since we are not under that heading, and because it isn't needed for the approach we've been taking. But it doesn't lead to a different result.

In my mind, no matter what you do, cases will be the natural way to think of the answer. I wouldn't try combining them into one formula.

Many people seem to think that a piecewise answer is somehow less mathematical; that is not true. In fact, the real world is piecewise! (Not to mention most computer programs.)
 
Why would you allow R to be positive or negative? Don't. (You didn't in post #6.)
Thank you very much. I mentioned the positive or negative of R since I have confusion about the relation of (x,y) and R, like is the relation between the sign of (x,y) and the sign of R. Since they can affect the output.

I finally understood the answer. I fixed one formula is because I will apply it into the integral later. So I tried to find out the simplest way to represent it, instead of cases. Just my bad way of thinking.

Thank you again for your patience.
 
Last edited:
Top