5th WSEAS / IASME International Conference on ENGINEERING EDUCATION (EE'08), Heraklion, Greece, July -4, 008 Calculus with Mathematica Labs at Riga Technical University V KREMENECKIS Department of Engineering Mathematics Riga Technical University Meza street, Riga LATVIA N KREMENECKA Department of Engineering Mathematics Riga Technical University Meza street, Riga LATVIA Abstract: - In the present paper we discuss how the Mathematica package is used at Riga Technical University to teach first year calculus The course of higher mathematics consists of three components: lectures, tutorials and computer labs Lab sessions run every second week and cover (at least partially) the material which is discussed during lectures and tutorials Some eamples of using Mathematica in calculus section of the course are presented Key-Words: - undergraduate mathematics, Mathematica package, calculus Introduction Modern teaching methods often recommend to use computer programs and packages during lectures and tutorials Two years ago software package Mathematica was introduced into the higher mathematics course at Riga Technical University (RTU) the largest engineering school in the Baltic States This package has very good tools to solve problems both analytically and numerically In addition, well-designed graphical interface allows one to display obtained results in the form of the two-dimensional or three-dimensional graphs The teaching load for first year students at RTU is distributed in the following way: three hours of lectures, two hours of tutorials and one hour of labs per week Labs run eight weeks per semester (the length of each semester at RTU is 6 weeks) in parallel with lectures and tutorials and during these labs students are taught how to use Mathematica Thus, students learn the theory during lectures and apply theoretical knowledge in practice during lab sessions using Mathematica In addition, students can also check results of their homework assignments with Mathematica It is shown in the present paper how Mathematica can be used to illustrate basic concepts of first-year calculus The Aim of Lab Sessions The main goal of lab sessions is to teach students how to use Mathematica by solving standard mathematical problems Different ways of representation of obtained results can be used not only in this course but also in other disciplines During lab sessions students can develop programming and algorithmization skills which can be useful in solving non-standard or research problems In the end of the course students have to pass the final test The test consists of si tasks (maimum three points for each task) Students can use all available materials In order to pass the test students have to score at least 0 points 3 Lab Sessions: Main Topics The following topics related to calculus course are discussed during lab sessions: ) Limits; ) Derivatives of functions of one variable and several variables; 3) Curve sketching; 4) Formula manipulation; 5) Comple numbers; 6) Integration (indefinite, definite and multiple); 7) Ordinary differential equations; 8) Laplace transform; 9) Series ISBN: 978-960-6766-86- 463 ISSN: 790-769
5th WSEAS / IASME International Conference on ENGINEERING EDUCATION (EE'08), Heraklion, Greece, July -4, 008 All these topics are covered in lectures and tutorials Students have to solve some problems for each topic at home Mathematica in this case is an additional tool which can help students to verify obtained results 4 Some Typical Eamples In this section some eamples of using Mathematica are presented ) Derivative of Implicit Function There are two ways how the derivative of implicit function can be calculated a) The first one is to present an implicit function as a two argument function in the form: F (, y) = 0 and derivative of y with respect to can be found by the formula d y F (, y) =, d F, y y ( ) where and y are independent variables This method can be illustrated by the following eample E Find the derivative of the implicit function: y + y = sin + y First, this function has to be transformed to appropriate form: F (, y) = y + y sin y = 0 In Mathematica we have to define two-argument function and to write down the appropriate formula: f[_,y_]=*sqrt[y]+y*sqrt[]-sin[/]-y^; -D[f[,y],]/D[f[,y],y] The result of these commands is the following: y Cos [ ] y + + + y y b) The second way to calculate the derivative of implicit function is to differentiate given epression with respect to assuming that y is a function of : y = y( ) and solve the obtained equation with respect to y ( ) E Let us find the derivative of the function written above with the second method The command is (to show that y is a function of we have to write formally y[] and no additional transformation is needed): Solve[D[*Sqrt[y[]]+y[]*Sqrt[]==Sin[/]+y[]^, ],y []] The result of this command is: 3 y [] Cos + y [] + y [] {{ y ' [] 3 ( + y [] 4 y [] ) }} ) Curve sketching We have implemented the algorithm for the analysis of the function and curve sketching in an interactive way because no special programming skills are required Of course, in general not all parts of the algorithm can be implemented in Mathematica (for eample, test for function periodicity), but most of them can be done in the package Here we ll show the implementation of the algorithm using the following function E 3 Analyze the given function and plot its graph: + 7 y = + 3 First, we define the function: y[_]=(^+*-7)/(^+*-3); Second, we find points where the function is undefined the zeros of the denominator: Solve[Denominator[y[]]==0,] The result is: {{ -3},{ }} 3 Net, we calculate the limits from the left and right at these points to investigate the behavior of the function near these points (Direction-> is for limit from the left, Direction->- is for limit from the right): Limit[y[],->-3,Direction->] Limit[y[],->-3,Direction->-] Limit[y[],->,Direction->] Limit[y[],->,Direction->-] The results are: for = 3 : the limit from the left is, the limit fro the right is there is the point of discontinuity of the nd type; for = : the limit from the left is, the limit from the right is there is the point of discontinuity of the nd type; 4 Determine whether the given function is even or odd ISBN: 978-960-6766-86- 464 ISSN: 790-769
5th WSEAS / IASME International Conference on ENGINEERING EDUCATION (EE'08), Heraklion, Greece, July -4, 008 For this purpose we ll analyze the ratio y( ) y( ) If this ratio is equal to then the function is even, if the result is - the function is odd In any other case the function is neither odd nor even y[-]/y[] For this function we have: ( 7 + )( 3 + + ) ( 7 + + )( 3 + ) so function is neither odd nor even 5 Find the -and y-intercepts In order to find the -intercepts we use the command Solve[y[]==0,] To determine the y-intercepts we calculate the value of the function at = 0: y[0] The results of the first command is { }{, + } and the y-intercept is 7 3 6 Points of minima and maima and intervals where the function is increasing or decreasing For this purpose we need to analyze the st derivative of the function: dy[_]=y [] which is equal to ( + ) 8 ( 3 + + ) Critical points of the first derivative can be found using the command: Solve[dy[]==0,] As a result we obtain, {{ -}} In order to find the intervals where the function is increasing or decreasing we plot the derivative in the interval which includes the points of discontinuity of the function (in general, these points are critical points for the st derivative) and zeros of the derivative: Plot[dy[],{,-5,}] 75 5-5 -4-3 - - -5 0 5-5 -75-0 This graph shows the intervals where the function is increasing and decreasing 7 Concavity and inflection points For this purpose we need to analyze the nd derivative of the function: dy[_]=y [] The result is ( + 6 + 3 ) 8 7 ( + ) 3 ( 3 + ) 3 Critical points of the second derivative can be found using the command: Solve[dy[]==0,]: ( 3 I 3 ), ( 3+ I ) 3, 3 3 Since the roots are comple, the function does not have inflection points For intervals of concavity we plot the nd derivative in the interval which includes points of discontinuity of the function (in general, these points are critical points for the nd derivative) and zeros of the nd derivative: Plot[dy[],{,-5,}] ISBN: 978-960-6766-86- 465 ISSN: 790-769
5th WSEAS / IASME International Conference on ENGINEERING EDUCATION (EE'08), Heraklion, Greece, July -4, 008 0 75 5-5 -4-3 - - -5 5-5 -75-0 This graph shows where the function is concave up and concave down 8 Asymptotes To construct inclined or horizontal asymptotes we ll use the formula y = k + b where y( ) k = lim, b = lim ( y( ) k ) ± ± We have to calculate k and b separately in cases where and : k=limit[y[]/,->-infinity] k=limit[y[]/,->infinity] b=limit[y[]-k*,->-infinity] b=limit[y[]-k*,->-infinity] The results are: 0 0 so there is the horizontal asymptote y = 9 Plotting the graph of the function and the asymptotes To plot the graph of the function and obtained horizontal asymptote the following command is used: Plot[{y[],},{,-5,}] The resulting graph is shown on the following figure: 75 5-5 -4-3 - - -5 0 5-5 -75 3) Solving Ordinary Differential Equations (Analytically and Numerically) Mathematica can be used to solve ordinary differential equations (ODE) both analytically and numerically Here we ll show how to solve ODE and use obtained solutions to plot a graph E 4 Solve the Cauchy problem analytically and numerically and plot the obtained solutions: 4 y 4y + y = 0, y( e) = 4e To solve this problem analytically the following command is used: -0 sol=dsolve[{4*^*y'[]- 4**y[]+y[]^==0,y[E]==4*E},y[],] The result is 4 {{ y[ ] }} Log[ ] To plot this function it is necessary to get obtained epression and to assign it to some function: f[_]=sol[[,,]] Now we can plot it: Plot[f[],{,,0}] 50 40 30 0 4 6 8 0 Let us to solve the same problem numerically In this case, the command is the following: ISBN: 978-960-6766-86- 466 ISSN: 790-769
5th WSEAS / IASME International Conference on ENGINEERING EDUCATION (EE'08), Heraklion, Greece, July -4, 008 sol=ndsolve[{4*^*y'[]- 4**y[]+y[]^==0,y[E]==4*E},y[],{,,0}] This command solves the ODE numerically for the interval [ ;0] The solution obtained is eact in this interval, but outside of it the etrapolation will be used The result of this command is the interpolating function, defined in the interval shown in NDSolve command: {{y[] InterpolatingFunction[{{,0}},<>][]}} To use this function we have to do the same operation as above: f[_]=sol[[,,]] Plot[f[],{,,0}] The result is: 7 6 5 4 3 4 6 8 0 Trying to plot this function outside the interval where the solution is obtained generates a warning message 4) Using of the Laplace Transform to Solve ODE The Laplace transform is often used to solve ODEs with initial values given at zero An eample of such a problem is shown below E 5 Solve the Cauchy problem using the Laplace transform: y + y y = 0, y ( 0 ) =, y () 0 = 3 + p {{ LaplaceTransform[ y[ ],, p] }} + p + p ( + ) E ( + ( + ) E ) 8 6 4 3 4 5 5 Conclusions The use of Mathematica for the first year course in higher mathematics at Riga Technical University is described in the paper Mathematica labs are designed in such a way that basic concepts of calculus are covered in parallel with lectures and tutorials in higher mathematics course at RTU Some eamples of using Mathematica to solve standard problems are shown These short programs can be useful to students studying calculus in high school and also studying other disciplines where the same problems have to be solved, for eample, physics, mechanics, electrodynamics and so on 6 Acknowledgments The authors wish to thank the Latvian Council of Science for financial support under the Project No 0439 The implementation of this algorithm is the following: sol=solve[{laplacetransform[y''[]+*y'[]- y[] 0,,p],y'[0],y[0] },LaplaceTransform[ y[],,p]] f[_]=inverselaplacetransform[apart[sol[[,,] ]],p,] Plot[f[],{,0,5}] As a result we obtain ISBN: 978-960-6766-86- 467 ISSN: 790-769
5th WSEAS / IASME International Conference on ENGINEERING EDUCATION (EE'08), Heraklion, Greece, July -4, 008 CALL FOR PAPERS 4th WSEAS/IASME International Conference on EDUCATIONAL TECHNOLOGIES (EDUTE'08) Corfu, Greece, October 6-8, 008 http://wwwwseasorg/conferences/008/corfu/edute Sponsored by WSEAS and WSEAS Transactions The organizing committee calls you to submit your papers, special sessions and 4-hours tutorials ISBN: 978-960-6766-86- 468 ISSN: 790-769