25.08.2021 Views

082-Engineering-Mathematics-Anthony-Croft-Robert-Davison-Martin-Hargreaves-James-Flint-Edisi-5-2017

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

2.3 Basic concepts of functions 61

both of which have the same result:

ans=9

affirming that f (x) =x 2 isamany-to-one function.

Noticethatthevariableusedbythefunctionisdefinedinbracketsafterthe@sign.This

indicatesthattheinputtothefunctionisxandthecommandcreatesafunctionhandle,

f. Giving the function a handle enables ittobe used elsewhere inthe program.

More complicated functions are usually created in a separate file and saved on the

computer’s internal storage devices. They can be easily reused to create sophisticated

programs. In MATLAB ® these files are saved with the file name extension .m and are

often termedm-files.

2.3.5 Parametricdefinitionofafunction

Functions are often expressed in the formy(x). For every value ofxthe corresponding

valueofycanbefoundandthepointwithcoordinates (x,y)canthenbeplotted.Sometimes

it is useful to expressxandycoordinates in terms of a third variable known as a

parameter.Commonlyweuset or θ todenoteaparameter.Thusthecoordinates (x,y)

of the points on a curve can be expressed inthe form

x=f(t)

y=g(t)

For example, given the parametric equations

x =t 2 y=2t 0t5

we can calculatexandyfor various values of the parametert. Plotting the points (x,y)

produces partof a curve known as a parabola.

2.3.6 Compositionoffunctions

Considerthefunctiony(x) = 2x 2 .Wecanthinkofy(x)asbeingcomposedoftwofunctions.Onefunctionisdescribedbytherule:‘squaretheinput’,whiletheotherfunction

isdescribed by the rule:‘double the input’. This isshown inFigure 2.9.

y(x)

8

x

g

square

the input

Figure2.9

Thefunction:y(x) =h(g(x)).

h

x 2 double

2x

the input

2

2

–2 1 x

Mathematically, ifh(x) = 2x andg(x) =x 2 then

y(x) = 2x 2 = 2(g(x)) =h(g(x))

The form h(g(x)) is known as a composition of the functions h and g. Note that the

compositionh(g(x)) isdifferent fromg(h(x)) as Example 2.5 illustrates.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!