Examples of Usage and Results

This page shows how to use TILU directly from the TILU home page. Although we expect more concerted use to come from computer algebra programs communicating to this socket, we'll assume for the moment that you are just trying it out by typing in problems.

Each example consists of an input (lower case), output (upper case) and sometimes a comment.


In the input page we assume you have left the following defaults alone:

Your input language is Common Lisp.
You have left the default variable, x as given.
You are asking for the default limits ( indefinite integral).
You have the simplification option set to Simp.

We illustrate the exact input you need to type or paste into the box "Type or paste the integrand here".

  1. Example
      (sin x)  

    When you press "activate integral request." you should get an answer page:

    The result of looking up

    (INTEGRATE (SIN X) X)
    is, in Common Lisp,
     (* -1 (COS X))
    which is simplified. It may be displayed more readably as
    -COS(X)
    
    
    (Why is the nosimp option available? Simplification takes time, and people who use this from another computer algebra program would shove this through their own simplifier anyway, you might want to do your own simplification) If you don't get this answer, TILU may be broken, or perhaps its host computer is down temporarily.

  2. Example
      (+ x (sin x)) 

    This is the output in Common Lisp,
     (+ (/ (EXPT X 2) 2) (* -1 (COS X)))
    
    which is simplified. It may be displayed more readably as
     2
    X
    -- - COS(X)
    2
    
    

    Comment
    The integrand is the sum of two integrands. the integral of each integrand is listed in the table. The integral of a sum is here interpreted as the sum of the separate integrals

  3. Example
      (* 3 (sin x)) 

    This is the output
    (* 3 (* -1 (COS (* 1 X)) (EXPT 1 -1))) 

    Comment
    A constant multiple of a known integral is similarly handled.

  4. Example: This is a polynomial, in "infix form" written c7*x^7+c4*x^4+c1*x+c0, and in Lisp:
     (+ (* c7 (expt x 7)) (* c4 (expt x 4)) (* c1 x)
                                     c0) 
    This is the output (+ (* C0 X) (* C1 (EXPT X 2) 1/2) (* C4 (EXPT X 5) 1/5) (* C7 (EXPT X 8) 1/8))
    Now let's set the Language to Mathematica. This is more convenient for most human readers, but not necessarily better for computers. The answer still comes out in Lisp (we could change this too, but our hope was to avoid using the Mathematica parser in our answer. Oh well.)

  5. Example
      1/(a x^2-b^2) 

    Note that if we had typed this in as Lisp it would have been
    (EXPT (+ (* A (EXPT X 2)) (* -1 (EXPT B 2))) -1)
    

    The answer comes out as the somewhat unwieldy:

    The result of looking up

    (INTEGRATE (EXPT (+ (* A (EXPT X 2)) (* -1 (EXPT B 2))) -1) X)
    
    is, in Common Lisp,
     (PROVIDED
      (WHEN (MINUSP (* A (EXPT B 2)))
        (* (LOG (* (+ (* -1 (EXPT B 2)) (* X (EXPT (* A (EXPT B 2)) 1/2)))
                   (EXPT (+ (* -1 (EXPT B 2))
                            (* -1 X (EXPT (* A (EXPT B 2)) 1/2)))
                         -1)))
           (EXPT (* 2 (EXPT (* A (EXPT B 2)) 1/2)) -1)))
      (WHEN (AND (MINUSP A) (PLUSP (* -1 (EXPT B 2))))
        (* (LOG (* (+ (EXPT (* -1 (EXPT B 2)) 1/2) (* X (EXPT (* -1 A) 1/2)))
                   (EXPT (+ (EXPT (* -1 (EXPT B 2)) 1/2)
                            (* -1 X (EXPT (* -1 A) 1/2)))
                         -1)))
           (EXPT (* 2 (EXPT (* -1 (EXPT B 2)) 1/2) (EXPT (* -1 A) 1/2)) -1)))
      (WHEN (AND (PLUSP A) (PLUSP (* -1 (EXPT B 2))))
        (* (ARCTAN (* X (EXPT A 1/2) (EXPT (EXPT (* -1 (EXPT B 2)) 1/2) -1)))
           (EXPT (* (EXPT (* -1 (EXPT B 2)) 1/2) (EXPT A 1/2)) -1)))
      (WHEN T NO-MORE-INTEGRALS-IN-TABLE))
    
    which is simplified. It may be displayed more readably as 
    
    
                                       2         2 1/2
                                     -B  + X (A B )
                                LOG(-------------------)
                                      2           2 1/2
                            2       -B  - 1 X (A B )
    PROVIDED(WHEN(MINUSP(A B ), ------------------------), 
                                            2 1/2
                                      2 (A B )
                                          2 1/2         1/2
                                       (-B )    + X (-A)
                                  LOG(----------------------)
                                         2 1/2           1/2
                              2       (-B )    - 1 X (-A)
    WHEN(MINUSP(A) && PLUSP(-B ), ---------------------------), 
                                           2 1/2     1/2
                                      2 (-B )    (-A)
                                            1/2
                                         X A
                                 ARCTAN(--------)
                                           2 1/2
                             2          (-B )
    WHEN(PLUSP(A) && PLUSP(-B ), ----------------), WHEN(T, 
                                     2 1/2  1/2
                                  (-B )    A
    
    
    
    NO-MORE-INTEGRALS-IN-TABLE))
    
    
    which has some provisos. It particular it requires checking if
    a*b^2<0 
    or
    a<0 and -b^2>0 
    or
    a>0 and -b^2>0 
    These were all generated by the answers in the table and combined. We will eventually add to this file more examples illustrating other options, especially different limits.

    Notes:A limitation inherent in the html form is that the variable of integration is of fixed maximum length: it should be a simple variable name with fewer than 8 characters.

Back to Tilu