Page 88 - MATLAB an introduction with applications
P. 88

MATLAB Basics ——— 73

                   (c)  >> S3=sqrt (x)
                        >> int (S3)
                        ans =
                            2/3*x^ (3/2)
                            >> int (S3,‘a’, ‘b’)
                        ans =
                            2/3*b^ (3/2)–2/3*a^ (3/2)
                            >> int (S3, 0.4, 0.7)
                        ans =
                            7/150*70^ (1/2)–4/75*10^ (1/2)

                   (d)  >> S4 = 7*x^5–6*x^4+11*x^3+4*x^2+8*x–9
                        >> int (S4)
                        ans =
                            7/6*x^6–6/5*x^5+11/4*x^4+4/3*x^3+4*x^2–9*x
                   (e)  >> S5=cos (a)
                        >> int (S5)
                        ans =
                            sin (a)

                   Example E1.24: Obtain the general solution of the following first order differential equations:
                                                       2
                             dy                       dy    dy
                                  t
                        (a)     =  5 − y         (b)    2  +  3  + y  =  0
                                     6
                             dt                       dt    dt
                             ds                       ds
                        (c)    = Ax 3            (d)     = Ax 3
                             dt                       dA
                   Solution:
                   (a)  >> solve (‘Dy=5*t–6*y’)
                        ans =
                            5/6*t–5/36+exp (–6*t)*C1
                   (b)  >> dsolve (‘D2y +3*Dy + y = 0’)
                        ans =
                            C1*exp (1/2*(5^ (1/2)–3)*t) + C2*exp (–1/2*(5^ (1/2) +3)*t)
                   (c)  >> dsolve (‘Ds =A*x^3’,‘x’)
                        ans =
                            1/4*A*x^4 + C1
                   (d)  >> dsolve (‘Ds=A*x^3’, ‘A’)
                        ans =
                            1/2*A^2*x^3 + C1













                   F:\Final Book\Sanjay\IIIrd Printout\Dt. 10-03-09
   83   84   85   86   87   88   89   90   91   92   93