f x x 44 Enter linear function g x x3 41x209x21 x 44 Enter difference of

F x x 44 enter linear function g x x3 41x209x21 x 44

This preview shows page 5 - 7 out of 8 pages.

, we can use the following commands. f = @(x) x-4.4; %Enter linear function g = @(x) x^3-4.1*x^2+0.9*x+2.1 - (x-4.4); %Enter difference of functions x1 = fzero(g,-1) %Find x-value of intersection f(x1) %Find y-value of intersection x2 = fzero(g,1) %Find x-value of intersection f(x2) %Find y-value of intersection There many other ways to do this computation with many computational tools. Students should learn what is most comfortable for them to use and practice these methods. Finding zeroes of functions is very important in mathematical studies, and often numerical methods are the only reasonable option for finding a solution. MatLab provides a professional way to produce graphs. Below is a MatLab code for graphing the linear and cubic functions and the linear and rational functions in this problem. 1 2 c l e a r % c l e a r previous d e f i n i t i o n s 3 4 xlab = ’ $x$ ’ ; % X - l a b e l 5 ylab = ’ $y$ ’ ; % Y - l a b e l 6 mytitle = ’ Linear and Cubic Functions ’ ; % Titl e 7 8 xx = l i n s p a c e ( - 7 ,10 ,100) ; 9 10 yy1 = 2 * xx - 1 . 2 ; 11 yy2 = xx .ˆ3 - 4.1 * xx .ˆ2 + 0.9 * xx + 2 . 1 ; 12 13 plot (xx , yy1 , ’b - , ’ LineWidth ’ , 1 . 5 ) ; 14 hold on 15 plot (xx , yy2 , ’ r - , ’ LineWidth ’ , 1 . 5 ) ; 16 grid 17 xlim ([ - 2 5 ] ) ; 18 ylim ([ - 25 30]) ; 19 20 leg1 = legend ( ’ $f (x) $ ’ , ’ $g (x) $ ’ , ’ l o c a t i o n ’ , ’ northwest ’ ) ; 21 set ( leg1 , ’ I n t e r p r e t e r ’ , ’ latex ’ ) ;
Image of page 5

Subscribe to view the full document.

22 set ( leg1 , ’ FontSize ’ ,12) ; 23 24 fontlabs = ’ Times New Roman ’ ; 25 xlabel ( xlab , ’ FontSize ’ ,14 , ’FontName ’ , fontlabs , ’ i n t e r p r e t e r ’ , ’ latex ’ ) ; 26 ylabel ( ylab , ’ FontSize ’ ,14 , ’FontName ’ , fontlabs , ’ i n t e r p r e t e r ’ , ’ latex ’ ) ; 27 t i t l e ( mytitle , ’ FontSize ’ ,16 , ’FontName ’ , ’ Times New Roman ’ , i n t e r p r e t e r ’ , ’ latex ’ ) ; 28 set ( gca , ’ FontSize ’ ,12) ; 29 30 print - depsc lin cub 18 . eps 31 32 f i g u r e (102) ; 33 34 mytitle2 = ’ Linear and Rational Functions ’ ; % Tit le 35 36 xxx = l i n s p a c e ( - 10 ,10 ,50) ; 37 xx1 = l i n s p a c e ( - 10 , - 3.08 ,100) ; 38 xx2 = l i n s p a c e ( - 3.075 ,2.075 ,100) ; 39 xx3 = l i n s p a c e (2.08 ,10 ,100) ; 40 41 42 yy = xxx - 4 . 4 ; 43 yy1 = 2.2 * xx1 . / ( xx1 .ˆ2 + xx1 - 6.4) ; 44 yy2 = 2.2 * xx2 . / ( xx2 .ˆ2 + xx2 - 6.4) ; 45 yy3 = 2.2 * xx3 . / ( xx3 .ˆ2 + xx3 - 6.4) ; 46 47 plot ( xxx , yy , ’b - , ’ LineWidth ’ , 1 . 5 ) ; 48 hold on 49 plot ( xx1 , yy1 , ’ r - , ’ LineWidth ’ , 1 . 5 ) ; 50 plot ( xx2 , yy2 , ’ r - , ’ LineWidth ’ , 1 . 5 ) ; 51 plot ( xx3 , yy3 , ’ r - , ’ LineWidth ’ , 1 . 5 ) ; 52 plot ([ - 10 1 0 ] , [ 0 0 ] , ’k : ’ , ’ LineWidth ’ , 1 . 5 ) ; 53 plot ([ - 3.078 - 3.078] ,[ - 10 10] , ’k : ’ , ’ LineWidth ’ , 1 . 5 ) ; 54 plot ( [ 2 . 0 7 8 2.078] ,[ - 10 10] , ’k : ’ , ’ LineWidth ’ , 1 . 5 ) ; 55 grid 56 xlim ([ - 10 10]) ; 57 ylim ([ - 10 10]) ; 58 59 leg1 = legend ( ’ $f (x) $ ’ , ’ $g (x) $ ’ , ’ l o c a t i o n ’ , ’ northwest ’ ) ; 60 set ( leg1 , ’ I n t e r p r e t e r ’ , ’ latex ’ ) ; 61 set ( leg1 ,
Image of page 6
Image of page 7
  • Fall '08
  • staff

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes