Graphs of Mod

The modulus function is a function that gives the magnitude of the number or variable or its combination. It is also called an absolute function. The output of this function will always be positive, no matter what the input was fed into the function. The modulus function can be plotted on a two-dimensional plane, and slight modifications in the argument of the functions can result in various shifts in the graphs.


Modulus Function Definition


The modulus function f(x) is defined as f(x) = |x|
Or it can also be stated as y=|x|
|x| is read as modulus or mod of x.

f(x)=x       when x>0-x   when x<0


Some examples of modulus function are f(x)=|x2|, f(x)=|x+1|, f(x)=|x-5|+6

Graph of a Modulus Function


The modulus function y=|x| can be plotted on a two-dimensional plane. Let us first see the graphs y=x and y=-x.



The function value cannot be negative when it comes to a modulus function. And hence, the y values cannot be negative for any x. So the graph of y=|x| will be trimmed below the y-axis, and it will be as follows:



The graph of y=|x| and y=|-x| will be the same.

Graph of |x|+|y|=a


The expression |x| + |y| = a is equivalent to the following four relations, along with the conditions on x and y.

x + y = a if x  0 and y  0, i.e. x & y are in the first quadrant

x  y = a if x  0 and y < 0, i.e. x & y are in the fourth quadrant

x + y = a if x < 0 and y  0i.e. x & y are in the second quadrant

x  y = a if x < 0 and y < 0, i.e. x & y are in the third quadrant

The four lines are plotted as dotted lines in the following graph. The graph of |x|+|y|=a is the only part which satisfies all the above conditions. The bold line shows the graph of |x|+|y|=a. Thus the graph of |x| + |y| = a will be a square rotated at 45° with a diagonal length of 2a. The side will be 2a.



Shifts in Graph Positions


The graph of y = |x| is a V-shaped graph. Now, let us see how the graph will change when the arguments inside and outside the function are changing. The change in the arguments can shift the graph vertically and horizontally. The possible change in arguments of y=|x| are

  • y=|x|+a
  • y=|x|-a
  • y=|x-a|
  • y=|x+a|
  • y=|x-a|+b
  • y=|x-a|-b
  • y=|x+a|-b
  • y=|x+a|+b

The function graph shifts upwards when a constant is added to the function, the constant being positive.



The function graph shifts downwards when a negative constant is added to the function.



If a negative constant is added to the function argument, the function shifts right.



If a positive constant is added to the function argument, the function shifts to the left.



More shifts can be possible by combining the above conditions. Adding constants will enable the following shifts.

For f(x)=|x-a|-b, the function shifts down and right.



For f(x)=|x-a|+b, the function shifts up and right.



For f(x)=|x+a|-b, the function shifted down and left.




For f(x)=|x+a|+b, the function shifted up and left.




In short, we can say that,

  • The function shifts up when a positive constant is added to |x|
For example: |x|+1

  • The function shifts down when a negative constant is added to |x|
For example: |x|-1

The function shifts right when a negative constant is added to x in |x|
For example: |x-1|

The function shifts left when a positive constant is added to x in |x|
For example:|x+1|

The function shifts up and right when a positive constant is added to |x| and a negative constant is added to x in |x|
For example: |x-1|+1

The function shifts up and left when a positive constant is added to |x| and a positive constant is added to x in |x|
For example: |x+1|+1

The function shifts down and left when a negative constant is added to |x| and a positive constant is added to x in |x|
For example: |x+1|-1

The function shifts down and left when a negative constant is added to |x| and a negative constant is added to x in |x|
For example: |x-1|-1


Solved Examples


Q1. Find the length of the diagonal of the square |x|+|y|=7.

Ans: The graph of |x|+|y|=a will be a square rotated at 45° with a diagonal length of 2a, and the side will be 2 a.
Here, a=7.
So, the length of the diagonal of the square is 2a=2×7=14 units

Q2. What is the area enclosed by the graph of |x|+|y|=4?

Ans: The graph of |x|+|y|=a will be a square rotated at 45° with a diagonal length of 2a, and the side will be 2 a.
So, for |x|+|y|=4a=4
So, the length of the square =2 a=2×4=42
The area of a square of side length a is a2.
Hence the area of the given square is (42)2=16×2=32 sq. units

Q3. Find the number of integer solutions to |x| + |y| = 5

Ans: The graph of |x|+|y|=a will be a square rotated at 45° with a diagonal length of 2a, and a side length 2 a.
So, the solutions of |x|+|y|=a will lie on this square, so we can count them if we need integer solutions.
For |x| + |y| = 5, the maximum value |x| can take is 5 when y=0.
We can see the possible solutions below:
When x=±5,y=0 , there will be 2 solutions
When x=±4,y=±1 , there will be 4 solutions
When x=±3,y=±2 , there will be 4 solutions
When x=±2,y=±3 , there will be 4 solutions
When x=±1,y=±4 , there will be 4 solutions
When x=0,y=±5 , there will be 2 solutions
Hence, there will be 2+4+4+4+4+2=20 integral solutions