Skip to content Skip to navigation

OpenStax-CNX

You are here: Home » Content » Transformation of graph by output

Navigation

Recently Viewed

This feature requires Javascript to be enabled.
 

Transformation of graph by output

Module by: Sunil Kumar Singh. E-mail the author

We modify output of a function in a couple of ways through arithmetic operations like addition, subtraction, multiplication, division and negation. These operations are similar to the one that we use to modify independent variable. The general symbolic representation for modification to output of a function is represented as :

a f x + d ; a , d R a f x + d ; a , d R

These changes are called external or post-composition modifications. These modifications compliment modifications by input, but in slightly different manner. In the case of modification to output, all effects take place in y-direction i.e. vertical direction as against horizontal transformation arising from modifications affected to input. Second, these transformations are in the direction of operation on output. For example, if we multiply output by a positive constant greater than 1, then graph of core function is stretched along y-axis. This means change in the output is reflected in the same direction in which operation takes place.

Addition and subtraction operation with function

In order to understand this type of transformation, we need to explore how output of the function changes as we add constant value to the output. If we add 1 unit to the function, then each value of function is incremented by 1 unit. It is a straight forward situation. In notation, we would say that the graph of “f(x) + 1” is same as the graph of f(x), which has been moved up by 1 unit. Alternatively, we can also describe this transformation by saying that vertical reference of measurement i.e. x-axis has moved down by 1 unit.

Figure 1: Each element of graph is shifted by same value.
Shifting of graph parallel to y-axis
 Shifting of graph parallel to y-axis  (to0.gif)

Similarly, if we subtract 1 unit from the function, then each value of function is decremented by 1 unit. In notation, we would say that the graph of “f(x) - 1” is same as the graph of f(x), which has been moved down by 1 unit. Alternatively, we can also describe this transformation by saying that vertical reference of measurement i.e. x-axis has moved up by 1 unit. We conclude :

The plot of y=f(x) + |a|; |a|>0 is the plot of y=f(x) shifted up by unit “a”.

The plot of y=f(x) - |a|; |a|>0 is the plot of y=f(x) shifted down by unit “a”.

We use these facts to draw plot of transformed function f(x±|a|) by shifting plot f(x) by unit “|a|” along y-axis. Each point forming the plot is shifted parallel to x-axis. In the figure below, the plot depicts modulus function y=|x|. It is shifted “1” unit up and the function representing shifted plot is y=|x|+1. Note that corner of plot at x=0 is also shifted by 1 unit along y-axis. Further, the plot is shifted “2” units down and the function representing shifted plot is |x|-2. In this case, corner of plot is shifted by 2 units down along y-axis.

Figure 2: Each element of graph is shifted by same value.
Shifting of graph parallel to y-axis
 Shifting of graph parallel to y-axis  (to4.gif)

Multiplication and division of function

Multiplication and division scales core graph in accordance with the operation. Scaling, however, is limited to vertical i.e. y-direction. This means modification due to either of these two arithmetic operations has no scaling impact in x-direction. If we multiply output of the function by a positive constant greater than 1, then graph of core function is stretched vertically by the factor, which is equal to the constant being multiplied. The magnification of graph i.e. stretching in y-direction is more noticeable in non-linear graphs like sine and cosine graphs, whose values are bounded in the interval [-1,1]. Let us consider function,

y = 4 sin x y = 4 sin x

Figure 3: Sine graph is stretched and shrunk.
Scaling of graph
 Scaling of graph  (to1.gif)

The amplitude of function "4sinx" is 4 times that of core graph "sinx". In the same fashion, a division by a positive constant greater than 1 results in shrinking of core graph by the factor, which is equal to constant being multiplies. Let us consider division of function :

y = 1 2 sin x y = 1 2 sin x

The amplitude of the graph "sinx" changes from 1 to 1/2 in the graph of "1/2 sinx".

Negation of function

What would happen if we negate output of a function? Answer is easy. All positive values will turn negative and all negative values will turn positive. It means that graph of core function which is being negated will be swapped across x-axis in the transformation. The graph of “f(-x)”, therefore, is mirror image in x-axis. In other words, we would need to flip the graph f(x) across x-axis to draw graph “-f(x)”.

Figure 4: The transformed graph is image of the core graph across x-axis.
Changing sign of the graph
 Changing sign of the graph  (to2a.gif)

Example 1

Problem : Draw graph of y = log e 1 x y = log e 1 x .

Solution : We simplify given function as :

y = log e 1 x = log e 1 log e x = log e x y = log e 1 x = log e 1 log e x = log e x

Here, core function is f(x) = log e (x) f(x) = log e (x) . Clearly, given function is transformed function of type y=-f(x). We obtain its graph by taking mirror image of the graph of y=f(x) about x-axis. We obtain its graph by taking mirror image of graph of core function about x-axis.

Figure 5: The transformed graph is image of the core graph about x-axis.
Changing sign of the graph
 Changing sign of the graph  (to9.gif)

Combined output operations

Certain functions are derived from core function as a result of multiple arithmetic operations on the output of core function. Consider an example :

f x = - 2 sin x - 1 f x = - 2 sin x - 1

We can consider this as a function composition which is based on sine function f(x) = sinx as core function. Here, sequence of operations on the function is important. Difference in interpreting input and output composition is that input composition is evaluated such that defining input transitions are valid. This results in a order of evaluation which gives precedence to addition/subtraction over multiplication/division. This evaluation order is clearly opposite to normal composition order of arithmetic operations in which multiplication/division is given precedence over addition/subtraction. We, therefore, say that decomposition of function for input operation is opposite to that of composition order. In the case of output operation, however, composition order of arithmetic operations is maintained during decomposition. It is logical also. After all, we are operating on a value – not something that goes into function to generate values in accordance with function rule as is the case with independent variable. It is, therefore, expected that we carry out arithmetic operations on the function just the way we evaluate algebraic expressions. In the nutshell, we shall give precedence to multiplication/division over addition/subtraction. In the example abvoe, we subtract "-1" to "-2sinx" - not to core function "sinx".

Keeping above in mind, the correct sequence of operation for graphing is :

(i) 2f(x) i.e. multiply function f(x) by 2 i.e. stretch the graph vertically by 2.

(ii) -2f(x) i.e. negate function f(x) i.e. flip the graph across x-axis.

(iii) -2f(x) – 1 i.e. subtract 1 from -2f(x) i.e. shift the graph down by 1 units.

Figure 6: The transformed graph is image of the base graph about x-axis.
Changing sign of the graph
 Changing sign of the graph  (to3a.gif)

Combined input and output operations

The combined input and output operation is symbolically represented as :

a f b x + c + d ; a , b , c , d R a f b x + c + d ; a , b , c , d R Carrying out output operation before input operation does not make sense. There will be two different outputs which are not connected to each other. Hence, logical order is that we first carry out input operations then follow it with output operations.

Example 2

Problem : Draw y 1 = log e x 2 y 1 = log e x 2

Solution : We rewrite the function :

y = log e x 2 + 1 y = log e x 2 + 1

In order to plot this function, we plot the graph of core function y = log e x y = log e x . Note that when y=0,

y = log e x = 0 x = e 0 = 1 y = log e x = 0 x = e 0 = 1

In this case, plot intersects x-axis at x=1. Now, the plot of y = log e x 2 y = log e x 2 is plot of y = log e x y = log e x shifted right by 2 units. Note that when y=0,

y = log e x 2 = 0 x 2 = e 0 = 1 x = 3 y = log e x 2 = 0 x 2 = e 0 = 1 x = 3

The plot of y = log e x 2 + 1 y = log e x 2 + 1 is plot of y = log e x 1 y = log e x 1 shifted up by 1 unit.

Figure 7: Each element of graph is shifted by same value.
Shifting of logarithmic graph parallel to y-axis
 Shifting of logarithmic graph parallel to y-axis  (to6.gif)

There is yet another alternative to obtain graph of transformed function by shifting axes themselves instead of plot. In the case of shifting either in x or y direction, the operation of shifting graph is equivalent to shifting of axis. Therefore, transformation involving shifting can be affected by shifting axes in opposite directions to that required for the graph. In the example case, we need to move y-axis by 2 units towards left and move x-axis by 1 unit downwards.

Figure 8: Each element of graph is shifted by same value in either direction.
Shifting of graph
 Shifting of graph  (to7.gif)

Example 3

Problem : Draw the plot y = cos 2 x y = cos 2 x .

Solution : We know that :

y = cos 2 x = 1 + cos 2 x 2 = 1 2 + cos 2 x 2 y = cos 2 x = 1 + cos 2 x 2 = 1 2 + cos 2 x 2

Here, core graph is y = cos x y = cos x . Multiplying independent variable by 2 shrinks core graph horizontally. As a result its period is reduced from 2π to π as shown in the graph. Division of cos2x by 2 is division operation on function. This operation shrinks the graph cos2x by 2 vertically. Note that amplitude of graph is reduced to 1/2 due to this operation. In the figure, lower graph corresponds to (cos2x)/2. Once we draw graph of (cos2x)/2, we draw given function y = cos 2 x y = cos 2 x by shifting the graph of (cos2x)/2 by 1/2 units up.

Figure 9: Each element of graph is shifted by same value.
Graph of squared cosine
 Graph of squared cosine  (to5.gif)

Acknowledgment

Author wishes to thank Ms. Aditi Singh, New Delhi for her editorial suggestions.

Content actions

Download module as:

Add module to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks