TEXtools: a MAPLE package for generating maths exercises formatted in L^{A}TEX

A. Martin andrew@ilovemaths.co.uk

August 14, 2001

Abstract

We present the maple package TEXtools which adds commands for producing L^{A}TEX from maple. Using the maple worksheet interface and the package described it is possible to generate sets of practice exercises formatted for processing by L^{A}TEX. The user needs only to work in maple to produce useable (L^{A}TEX ‘processable’) exercise sets. The package was designed to aid teachers and lecturers with the production of quality ‘L^{A}TEXed’ exercise sheets for some of the more repetitive exercises required when learning mathematics.

In this paper we outline the procedures available in the package and give examples of their use. Finally we give the maple code for generating a whole set of exercises on Partial Fractions. The code for the package and the example set of exercises are available

for download from the author’s web page http://www.ilovemaths.co.uk/textools/.

Please note this work is very much in progress. Suggestions for improvments and additions are welcomed by the author.

Contents

1 Introduction 2

2 Installing the package 2

3 Outline of use 3

4 Main procedures 4

5 Example 10

6 The future... 18

1 Introduction

The impetus for this project came from the author’s wish to use the power of maple to aid the production of practice exercise sheets with (accurate!) answers, generated by maple (of course!). The package is most useful for the topics in maths typically studied at ‘A’ and early undergraduate levels where lots of fairly repetitive practice is required and where students still require answers. Example topics are Partial fractions, Integration by parts and Differentiation. The package allows one writing a set of exercises to concentrate on the questions and content. The answers to the exercises can be generated by maple. This should improve the quality of the exercises, make production easier and ensure mathematically correct answers. Producing good quality typset mathematics usually means using L^{A}TEX or a TEX based system of some sort. Since maple has built in procedures for generating L^{A}TEX output, L^{A}TEX is the obvious choice of output for this package. Use of the TEXtools package requires a working L^{A}TEX setup so the final output can be processed and printed. For best results a working knowledge of L^{A}TEX is also required. The L^{A}TEX code generated by the package can be edited by the user post-maple generation (of course re-processing the maple worksheet will overwrite any changes made by the user - beware!) Since this package writes (and overwrites) files it is recommended that you have backup copies of important work. The package only writes files with .tex extensions usually into the directory from which maple was started. You use this package at your own risk and the author takes no responsibility for loss of data resulting from the use of the package. The descriptions in this document refer to version 1.3.2 of the TEXtools package and was designed using maple v Release 5. It is hoped future releases will maintain backwards compatibility but where this is not possible at the very least warning messages will be given with advice on how to upgrade worksheets. To check the version number look at the top of the source code or in any files created by TEXtools.

2 Installing the package

Installing the package will vary on different platforms but the following should work. The author is happy to give advice on installing and setting up the package.

1. Create a directory textools and subdirectories code and src. Place the source code file textools.src into the src directory.

2. Add the path to the directories created in step 1 to the library path by adding into the maple initialization file (.mapleinit on UNIX, maple.ini on Windows) the following lines:

       textools:=`textoolsfilepath`:
       libname:=textools,libname:

where textoolsfilepath is the path of the directories created in step 1.

On my Windows machine where the path of the directories created is c:\maple\textools the lines I added were

       textools:=`c:/maple/textools`:
       libname:= textools, libname:

3. cd into textools/src, start command line maple and type read `textools.src`;. If no errors are produced quit maple. If errors are produced go back to step 1.

4. Make sure that the files created by maple inside the directory textools/code are readable and executable.

Once the package has been installed its procedures should be accessible after the command

with(TeXtools) is issued.

To test the system type with(TeXtools); (with a semi-colon) and maple should list the commands made available by the package.

   > with(TeXtools);
   Warning, maximum line length in file 500 characters.

[AddQ, AddQue, AddQueP, AddQueTabular, AddToAns, AddToAnsLatexOf , AddToQs, AddToQsLatexOf , EndFile, EndMulticols, EndNumber, EndTabular, MakeHolderFile, StartFile, StartMulticols, StartNumber, StartTabular, init, processIt]

The warning regarding line length is regarding the maximum line length that will be written to the files and will not be a concern to most users. If you wish to install an updated version of the package, step 3 above should be repeated to write the new procedures. Then use with(TeXtools); to ensure the new functions are available.

3 Outline of use

Here we briefly describe what the package does and how to use it. The user generates the questions and answers for the set of exercieses using maple. In between the questions TEXtools commands are issued which write the questions and answers to two files questions.tex and answers.tex. These files hold the questions and answers in L^{A}TEX format. Finally there is a command to generate a file which when processed by L^{A}TEX will call the question and answer files. These three files can be processed by L^{A}TEX without any editing by the user. (This is assuming the TEXtools procedures were used appropriately in the maple worksheet.) For best results the L^{A}TEX style file textools.sty should be used. Hopefully all of this will become clearer with the examples we give in what follows! Further, the files questions.tex and answers.tex can be used for inclusion into other projects, for example a text book. Only a reference to the L^{A}TEX code needs to be added to the L^{A}TEX for the book, using the L^{A}TEX input command. The files generated are usually called questions.tex and answers.tex but options for choosing filenames are available. It should be noted that maple will write these files to the directory from which it was started. We hope to address this is future versions but for now ensure that maple is started from where you would like the files to be written.

4 Main procedures

We describe the main procedures of the package and give the syntax for their use and some examples. To use the procedures the TEXtools package must first be loaded using

with(TeXtools);.

Procedure: StartFile

Calling sequence: StartFile(optional parameters);

Optional parameters: Qfilename=filename - creates the file named filename.tex where the questions are written. Afilename=filename - creates the file named filename.tex where the answers are written. The two filenames must be different! If the options Qfilename and Afilename are not specified the default names are questions.tex and answers.tex. Procedure: EndFile Calling sequence: EndFile(); Parameters: None The files questions.tex and answers.tex (or those specified in the StartFile() command) are closed. Procedure: StartNumber Calling sequence: StartNumber(); Parameters: None It is proposed that in future versions optional arguments will be availble for different numbering styles and to begin numbering at a number other than 1. Numbering is started so the questions and answers are numbered in the final output. Procedure: EndNumber Calling sequence: EndNumber()

Parameters: None Ends the numbering started by StartNumber. Procedure: AddQue

Calling sequence: AddQue(instruction, question, answer, optional parameters);

Parameters: instruction - A string containing the instruction for the question, e.g. `Integrate‘ . question - A maple expression of the question, e.g. 3*x^2. answer - A maple expression of the answer to the question, e.g. x^3+c. Optional parameters are: style=inline, displayinline, display - defines the style in which the question expression is displayed by L^{A}TEX. The default is display if this option is not specified. The answers are set to inline. A whole question consisting of an instruction, an expression for the question and an expression for the answer is added to files questions.tex and answers.tex (or those specified in the StartFile() command).

Example

   > StartFile();
   > StartNumber();
   > C:=`By factorising the denominator write the following expression in partial
   fractions.`;

C := By factorising the denominator write the following expression in partial fractions.

   > Q:=(x^2+x+1)/( (x^2-1)*(x^2+1) );

Q := \frac{x^{2} + x + 1}{(x^{2} − 1) (x^{2} + 1)}

   > A:=convert(Q,parfrac,x);

A := \frac{3}{4} \frac{1}{x − 1} − \frac{1}{4} \frac{1}{x + 1} − \frac{1}{2} \frac{x}{x^{2} + 1}

   > AddQue(C,Q,A);
   > EndNumber();
   > EndFile();

The resulting (question) L^{A}TEX when processed is as follows;

1. By factorising the denominator write the following expression in partial frac-

tions.

\frac{x^{2} + x + 1}{(x^{2} − 1) (x^{2} + 1)}

We do not show the output of the answer file but it is similar. Procedure: AddQ

Calling sequence: AddQ(instruction);

Parameters: instruction - A string containing the instruction for the question, e.g. `Integrate‘ . The string can be empty in which case only numbering is inserted into the question and answer files. It is intended that this procedure be used to insert the main numbering and instruction for a multiple part question.

Example See the example below for the procedure AddQueP where the AddQ procedure is used. Procedure: AddQueP

Calling sequence: AddQueP(question, answer, optional arguments);

Parameters: question - A maple expression of the question, e.g. 3*x^2. answer - A maple expression of the answer to the question, e.g. x^3+c. Optional parameters are: style=inline, displayinline, display - defines the style in which the question expression is displayed by L^{A}TEX. The default is inlinedisplay if this option is not specified. The answers are set to inlinedisplay. A sub-question or part of a question is added consisting of an expression for the question and an expression for the answer.

Example We show the use of this procedure together with the procedure AddQue previously described.

   > StartFile();
   > StartNumber(); # start main question numbering
   > AAA:=`Integrate the following expressions with respect to $x$`;

AAA := Integrate the following expressions with respect to $x$

   > I1:=x^4+x+4;

I1 := x^{4} + x + 4

   > I2:=3*x^4-5*x^2+3*x+7;

I2 := 3 x^{4} − 5 x^{2} + 3 x + 7

   > AddQ(AAA);
   > StartNumber(); # start numbering for the following parts of the question
   > AddQueP(I1,int(I1,x));
   > AddQueP(I2,int(I2,x));
   > EndNumber(); # end numbering for parts of question
   > EndNumber();
   > EndFile();

The resulting L^{A}TEX when processed is as follows;

1. Integrate the following expressions with respect to x;

(a) x^{4} + x + 4

(b) 3 x^{4} − 5 x^{2} + 3 x + 7

We have shown how questions can divided into multiple parts. We now introduce procedures for putting questions in columns.

Procedure: StartMulticols

Calling sequence: StartMulticols(number1,number2);

Parameters: number1 - the number of columns required for the questions (1 is allowed). number2 - the number of columns required for the answers (1 is allowed).

Starts multiple colums in the question and answer files. Must be ended by the EndMulticols command.

Procedure: EndMulticols

Calling sequence: EndMulticols();

Parameters: None

Ends the multiple columns started by the StartMulticols command.

Example The following demonstrates how to produce questions in multiple columns.

   > StartFile();
   > StartNumber();
   > C:=`Express the following in partial fractions;`:
   > AddQ(C);
   > StartMulticols(3,2);
   > Q:=3/((x+1)*(x-1));

Q := 3 \frac{1}{(x + 1) (x − 1)}

   > A:=convert(Q,parfrac,x);

A := −\frac{3}{2} \frac{1}{x + 1} + \frac{3}{2} \frac{1}{x − 1}

   > AddQueP(Q,A);
   > Q:=x/((x-4)*(x-1));AddQueP(Q,convert(Q,parfrac,x));

Q := \frac{x}{(x − 4) (x − 1)}

   > Q:=(x-1)/((x+2)*(x-2));AddQueP(Q,convert(Q,parfrac,x));

Q := \frac{x − 1}{(x + 2) (x − 2)}

   > Q:=2/((2*x-1)*(x-2));AddQueP(Q,convert(Q,parfrac,x));

Q := 2 \frac{1}{(2 x − 1) (x − 2)}

   > Q:=(x+3)/(x*(x+1));AddQueP(Q,convert(Q,parfrac,x));

Q := \frac{x + 3}{x (x + 1)}

   > Q:=(2*x-1)/((x+1)*(3*x+2));AddQueP(Q,convert(Q,parfrac,x));

Q := \frac{2 x − 1}{(x + 1) (3 x + 2)}

   > EndMulticols();
   > EndNumber();
   > EndFile();

1. Express the following in partial fractions;

\begin{matrix}(a) 3 \frac{1}{(x + 1) (x − 1)} \\ (b) & \frac{x}{(x − 4) (x − 1)} \end{matrix}  \begin{matrix}(c) & \frac{x − 1}{(x + 2) (x − 2)} \\ (d) 2 \frac{1}{(2 x − 1) (x − 2)} \end{matrix} \begin{matrix}(e) & \frac{x + 3}{x (x + 1)} \\ (f) & \frac{2 x − 1}{(x + 1) (3 x + 2)} \end{matrix}

Procedure: inlinelatex, inlinedisplaylatex, displaylatex

Calling sequences: inlinelatex(expr, filename);, inlinedisplaylatex(expr, filename);,
displaylatex(expr, filename);

Parameters: expr - Any expression. filename - (optional) A filename to which the L^{A}TEXis written to. These commands work in exactly the same as maple’s built in latex() command except that: inlinelatex - the expression will be inline. displaylatex - the expression will be displayed. inlinedisplaylatex - the expression will be inline but with display style sizing.

These proceudres are called by the other procedures and will rarely be used on their own. If they are required by the user then they must be called with the readlib command. We now consider four further procedures that allow text or expressions to be inserted directly into the L^{A}TEX files. The ‘text’ can also include elements of L^{A}TEX with a few cavets. Procedure: AddToQsLatexOf

Calling sequence: AddToQsLatexOf(expression);

Parameters: expression - A maple expression. Optional parameters are:

style=inline, displayinline, display - defines the style in which the expression is

displayed by L^{A}TEX. The default is display if this option is not specified. Writes the L^{A}TEX of the maple expression to the questions file. Procedure: AddToAnsLatexOf

Calling sequence: AddToQsLatexOf(expression);

Parameters: expression - A maple expression. Optional parameters are:

style=inline, displayinline, display - defines the style in which the expression is

displayed by L^{A}TEX. The default is inlinedisplay if this option is not specified. Writes the L^{A}TEX of the maple expression to the answers file. Procedure: AddToQs

Calling sequence: AddToQs(string);

Parameters: string - A string containing the text to be written to the questions file. The string can contain L^{A}TEX syntax but to include a backslash two must be used “\\”. Procedure: AddToAns

Calling sequence: AddToAns(string);

Parameters: string - A string containing the text to be written to the answers file. Procedure: MakeHolderFile

Calling sequence: MakeHolderFile(filename, optional parameters);

Parameters: filename - A filename for the file. Optional parameters are: title=string - Inserts a title at the top of the document. author=string - Prints the authors name at the bottom right of the document. date=boolean (true/false) - Prints the current date at the bottom right of the document if set to true. numberpage=boolean - Numbers the pages of output if set to true. anspage=boolean - Places the answwers on a separate page if set to true. Default is to place answers as the bottom of the page with a horizontal rule in between. Procedure: processIt

Calling sequence: processIt(filename);

Parameters: filename - filename of file to be processed by L^{A}TEX and viewed by DVI viewer. Uses maple’s system command to run a L^{A}TEX processor and DVI viewer. For this function to work the variables LatexPath and DVIPath must be set in the maple intialisation file. For my set up the follwing lines are included in my maple.ini file.

  LatexPath:=`c:\\texmf\\miktex\\bin\\latex`:
  DVIPath:=`c:\\texmf\\miktex\\bin\\yap -1`:

Note the double backslashes are required!

5 Example

In this section we give a complete example worksheet with annotations. The worksheet generates a set of practice exercises on Partial Fractions. The worksheet is available for download from the authors website.

   > # Partial Fractions Exercise Sheet (Supplied with TeXtools ver 1.3.2)
   > restart;
   > with(TeXtools);
   Warning, maximum line length in file 500 characters.

[AddQ, AddQue, AddQueP, AddQueTabular, AddToAns, AddToAnsLatexOf , AddToQs, AddToQsLatexOf , EndFile, EndMulticols, EndNumber, EndTabular, MakeHolderFile, StartFile, StartMulticols, StartNumber, StartTabular, init, processIt]

We issue the StartFile(); command which sets up two files: questions.tex and answers.tex. These two files are progressively written to as the questions and answers are produced in MAPLE. The StartNumber(); command starts off the question numbering in both the question and answer files.

> StartFile();
> StartNumber();
> # linear brackets
> C:=`Express the following in partial fractions;`:
> AddQ(C);

AddQ(arg); appends the arg to the question file (exactly as it is, except for some special characters like \ which need to be doubled to appear in the final latex file)

The command below introduces multiple columns. The first argument relates to the number of columns required in the questions and the second relates to the number of columns in the answers.

> StartMulticols(3,2);
> Q:=3/((x+1)*(x-1));

Q := 3 \frac{1}{(x + 1) (x − 1)}

> A:=convert(Q,parfrac,x);

A := −\frac{3}{2} \frac{1}{x + 1} + \frac{3}{2} \frac{1}{x − 1}

> AddQueP(Q,A);

The command AddQueP(args); adds the question and answer to the respective files, processing them using a variant of MAPLEs latex() command.

> Q:=x/((x-4)*(x-1));AddQueP(Q,convert(Q,parfrac,x));

Q := \frac{x}{(x − 4) (x − 1)}

> Q:=(x-1)/((x+2)*(x-2));AddQueP(Q,convert(Q,parfrac,x));

Q := \frac{x − 1}{(x + 2) (x − 2)}

> Q:=2/((2*x-1)*(x-2));AddQueP(Q,convert(Q,parfrac,x));

Q := 2 \frac{1}{(2 x − 1) (x − 2)}

> Q:=(x+3)/(x*(x+1));AddQueP(Q,convert(Q,parfrac,x));

Q := \frac{x + 3}{x (x + 1)}

> Q:=(2*x-1)/((x+1)*(3*x+2));AddQueP(Q,convert(Q,parfrac,x));

Q := \frac{2 x − 1}{(x + 1) (3 x + 2)}

> EndMulticols();

The command must be used to end the multcolumns. If this is ommitted LaTeX will not run properly. Of course, if any mistakes are made when prodocuing the worksheet simply execute all of the commands again. (Use Edit =>Execute =>Worksheet). This will re-write all files previously written. In fact, the way I produce worksheets that use TeXtools is to work out all of the questions I want and their answers then add in the TeXtools commands.

> # more than two linear brackets on denominator
> AddQ(``);

The commad above starts off a new question (this means putting another number in the question and answer files), the empty string means nothing else is written. cf. question 2 on the worksheet to see what the output is.

> StartMulticols(2,1);
> Q:=3*x/((x-1)*(x-2)*(x-3));AddQueP(Q,convert(Q,parfrac,x));

Q := 3 \frac{x}{(x − 1) (x − 2) (x − 3)}

> Q:=(x^2-2*x+4)/(x*(x-3)*(x+1));AddQueP(Q,convert(Q,parfrac,x));

Q := \frac{x^{2} − 2 x + 4}{x (x − 3) (x + 1)}

> EndMulticols();
> # quadratic bracket in denominator
> AddQ(``);
> StartMulticols(3,2);
> Q:=2/((x-1)*(x^2+1));AddQueP(Q,convert(Q,parfrac,x));

Q := 2 \frac{1}{(x − 1) (x^{2} + 1)}

> Q:=(x-3)/((x+4)*(x^2-2));AddQueP(Q,convert(Q,parfrac,x));

Q := \frac{x − 3}{(x + 4) (x^{2} − 2)}

> Q:=(x+3)/(x*(x^2+2));AddQueP(Q,convert(Q,parfrac,x));

Q := \frac{x + 3}{x (x^{2} + 2)}

> Q:=(2*x^2+x+1)/((x-3)*(2*x^2-1)); AddQueP(Q,convert(Q,parfrac,x));

Q := \frac{2 x^{2} + x + 1}{(x − 3) (2 x^{2} − 1)}

> Q:=(x^2+1)/(x*(2*x^2-1)*(x-1)); AddQueP(Q,convert(Q,parfrac,x));

Q := \frac{x^{2} + 1}{x (2 x^{2} − 1) (x − 1)}

> Q:=(2*x^2+1)/( (x^2+1)*(x-1) ); AddQueP(Q,convert(Q,parfrac,x));

Q := \frac{2 x^{2} + 1}{(x^{2} + 1) (x − 1)}

> EndMulticols();
> # a long question to practice
> C:=`Convert the following expression to partial fractions.`;

C := Convert the following expression to partial fractions.

> Q:=(x^3-1)/( (x+2)*(2*x+1)*(x^2+1) );

Q := \frac{x^{3} − 1}{(x + 2) (1 + 2 x) (x^{2} + 1)}

> A:=convert(Q,parfrac,x);

A := \frac{3}{5} \frac{1}{x + 2} − \frac{3}{5} \frac{1}{1 + 2 x} + \frac{1}{5} \frac{x − 1}{x^{2} + 1}

> AddQue(C,Q,A);

The command AddQue(); adds a whole question at once. Generally use for questions with a straight forward layout.

> # this one requires factorisation of the denominator first!
> C:=`By factorising the denominator write the following expression in partial
fractions.`;

C := By factorising the denominator write the following expression in partial fractions.

> Q:=(x^2+x+1)/( (x^2-1)*(x^2+1) );

Q := \frac{x^{2} + x + 1}{(x^{2} − 1) (x^{2} + 1)}

> A:=convert(Q,parfrac,x);

A := \frac{3}{4} \frac{1}{x − 1} − \frac{1}{4} \frac{1}{x + 1} − \frac{1}{2} \frac{x}{x^{2} + 1}

> AddQue(C,Q,A);
> # repeated linear brackets in denominator
> AddQ(`Express the following in partial fractions;`);
> StartMulticols(3,1);
> Q:=x/((x-1)*(x-2)^2); AddQueP(Q,convert(Q,parfrac,x));

Q := \frac{x}{(x − 1) (x − 2)^{2}}

> Q:=(x^2-1)/(x^2*(2*x+2)); AddQueP(Q,convert(Q,parfrac,x));

Q := \frac{x^{2} − 1}{x^{2} (2 x + 2)}

> Q:=3/(x*(3*x-1)^2); AddQueP(Q,convert(Q,parfrac,x));

Q := 3 \frac{1}{x (3 x − 1)^{2}}

> Q:=1/((x+2)*(x-1)^2); AddQueP(Q,convert(Q,parfrac,x));

Q := \frac{1}{(x + 2) (x − 1)^{2}}

> Q:=1/((x-2)*(x+3)^2); AddQueP(Q,convert(Q,parfrac,x));

Q := \frac{1}{(x − 2) (x + 3)^{2}}

> Q:=(x-2)/((3*x+1)*(x-1)^2); AddQueP(Q,convert(Q,parfrac,x));

Q := \frac{x − 2}{(3 x + 1) (x − 1)^{2}}

> EndMulticols();
> # questions requiring polynomial division, but we give the form required
for partial fractions so polynomial division not required from student.
> Q1:=`Given that` ;

Q1 := Given that

> A:='A':B='B':C:='C':Q2:=(x^2-2)/((x+3)*(x-1))=A+B/(x+3)+C/(x-1);

Q2 := \frac{x^{2} − 2}{(x + 3) (x − 1)} = A + \frac{B}{x + 3} + \frac{C}{x − 1}

> Ans:=convert(lhs(Q2),parfrac,x);

Ans := 1 − \frac{7}{4} \frac{1}{x + 3} − \frac{1}{4} \frac{1}{x − 1}

> AddQue(Q1,Q2,Ans);

We still need to add a bit to the end of the question so use the command AddToQs();. There is also a command AddToAns(). There are also two commands AddToQsLatexOf() and AddToAnsLatexOf which adds the LaTeX code of an expression to the respective files.

> Q3:=`find the values of the constants $A$, $B$ and $C$.`;

Q3 := find the values of the constants $A$, $B$ and $C $.

> AddToQs(Q3);
> Q1:=`Given that` ;

Q1 := Given that

> A:='A':B='B':C:='C':Q2:=(x^2-x-24)/((x+2)*(x-4))=A+B/(x+2)+C/(x-4);

Q2 := \frac{x^{2} − x − 24}{(x + 2) (x − 4)} = A + \frac{B}{x + 2} + \frac{C}{x − 4}

> Ans:=convert(lhs(Q2),parfrac,x);

Ans := 1 + 3 \frac{1}{x + 2} − 2 \frac{1}{x − 4}

> AddQue(Q1,Q2,Ans);
> Q3:=`find the values of the constants $A$, $B$ and $C$.`;

Q3 := find the values of the constants $A$, $B$ and $C $.

> AddToQs(Q3);
> EndNumber();
> EndFile();

The two commands above simply end the numbering and close the files.

We now produce a holding file which reads in the questions and answers. The file produced is designed to be edited by a human so various standard headers etc. can be added. It is intended that this file is not usually produced by MAPLE and a users own template file used. The function is included here for completeness and as a basis for further editing. Remember to comment out the command if you have edited the file and don’t want it to be overwritten when the this worksheet is re-run (or you could name your file to something different).

> MakeHolderFile(parfrac,title=`Partial Fractions`, date=true, anspage=true);

The following command will run LaTeX on the file named (in this case parfrac) and preview it in YAP. (The paths are given in the Maple initialisation file)

> processIt(parfrac);

[0, “”]

> # 0 indicates success and "" is the output.
> # (c) 2001 Andrew Martin.

And the output looks like...

Practice Exercises

Partial Fractions

1. Express the following in partial fractions;

\begin{matrix}(a) 3 \frac{1}{(x + 1) (x − 1)} \\ (b) & \frac{x}{(x − 4) (x − 1)} \end{matrix}  \begin{matrix}(c) & \frac{x − 1}{(x + 2) (x − 2)} \\ (d) 2 \frac{1}{(2 x − 1) (x − 2)} \end{matrix}  \begin{matrix}(e) & \frac{x + 3}{x (x + 1)} \\ (f) & \frac{2 x − 1}{(x + 1) (3 x + 2)} \end{matrix}
2. (a) 3 \frac{x}{(x − 1) (x − 2) (x − 3)}  (b) \frac{x^{2} − 2 x + 4}{x (x − 3) (x + 1)}
\begin{matrix}3. (a) 2 \frac{1}{(x − 1) (x^{2} + 1)} \\ (b) & \frac{x − 3}{(x + 4) (x^{2} − 2)} \end{matrix}  \begin{matrix}(c) & \frac{x + 3}{x (x^{2} + 2)} \\ (d) & \frac{2 x^{2} + x + 1}{(x − 3) (2 x^{2} − 1)} \end{matrix}  \begin{matrix}(e) & \frac{x^{2} + 1}{x (2 x^{2} − 1) (x − 1)} \\ (f) & \frac{2 x^{2} + 1}{(x^{2} + 1) (x − 1)} \end{matrix}

4. Convert the following expression to partial fractions.

\frac{x^{3} − 1}{(x + 2) (1 + 2 x) (x^{2} + 1)}

5. By factorising the denominator write the following expression in partial fractions.

\frac{x^{2} + x + 1}{(x^{2} − 1) (x^{2} + 1)}

6. Express the following in partial fractions;

\begin{matrix}(a) & \frac{x}{(x − 1) (x − 2)^{2}} \\ (b) & \frac{x^{2} − 1}{x^{2} (2 x + 2)} \end{matrix}  \begin{matrix}(c) 3 \frac{1}{x (3 x − 1)^{2}} \\ (d) & \frac{1}{(x + 2) (x − 1)^{2}} \end{matrix}  \begin{matrix}(e) & \frac{1}{(x − 2) (x + 3)^{2}} \\ (f) & \frac{x − 2}{(3 x + 1) (x − 1)^{2}} \end{matrix}

7. Given that

\frac{x^{2} − 2}{(x + 3) (x − 1)} = A + \frac{B}{x + 3} + \frac{C}{x − 1}

find the values of the constants A, B and C.

8. Given that

\frac{x^{2} − x − 24}{(x + 2) (x − 4)} = A + \frac{B}{x + 2} + \frac{C}{x − 4}

find the values of the constants A, B and C.

Answers

1. (a) −3/2 (x + 1)^{−1} + 3/2 (x − 1)^{−1} ; (b) 4/3 (x − 4)^{−1} − 1/3 (x − 1)^{−1} ; (c) 3/4 (x + 2)^{−1} + 1/4 (x − 2)^{−1}  (d) −4/3 (2 x − 1)^{−1} + 2/3 (x − 2)^{−1} ; (e) 3 x^{−1} − 2 (x + 1)^{−1} ; (f) 3 (x + 1)^{−1} − 7 (3 x + 2)^{−1}

2. (a) 3/2 (x − 1)^{−1} − 6 (x − 2)^{−1} + 9/2 (x − 3)^{−1}

(b) −4/3 x^{−1} + \frac{7}{12} (x − 3)^{−1} + 7/4 (x + 1)^{−1}

3. (a) (x − 1)^{−1} − \frac{x + 1}{x^{2} + 1} ; (b) −1/2 (x + 4)^{−1} + 1/2 \frac{x − 2}{x^{2} − 2} ; (c) 3/2 x^{−1} − 1/2 \frac{−2 + 3 x}{x^{2} + 2}  (d) \frac{22}{17} (x − 3)^{−1} − 1/17 \frac{13 + 10 x}{2 x^{2} − 1} ; (e) x^{−1} + 2 (x − 1)^{−1} − 3 \frac{1 + 2 x}{2 x^{2} − 1} ; (f) 3/2 (x − 1)^{−1} + 1/2 \frac{x + 1}{x^{2} + 1}

4. 3/5 (x + 2)^{−1} − 3/5 (1 + 2 x)^{−1} + 1/5 \frac{x − 1}{x^{2} + 1}

5. 3/4 (x − 1)^{−1} − 1/4 (x + 1)^{−1} − 1/2 \frac{x}{x^{2} + 1}

6. (a) (x − 1)^{−1} + 2 (x − 2)^{−2} − (x − 2)^{−1} (b) −1/2 x^{−2} + 1/2 x^{−1}

(c) 3 x^{−1} + 9 (3 x − 1)^{−2} − 9 (3 x − 1)^{−1}

(d) 1/9 (x + 2)^{−1} + 1/3 (x − 1)^{−2} − 1/9 (x − 1)^{−1}

(e) 1/25 (x − 2)^{−1} − 1/5 (x + 3)^{−2} − 1/25 (x + 3)^{−1}

(f) −\frac{21}{16} (3 x + 1)^{−1} − 1/4 (x − 1)^{−2} + \frac{7}{16} (x − 1)^{−1}

7. 1 − 7/4 (x + 3)^{−1} − 1/4 (x − 1)^{−1}

8. 1 + 3 (x + 2)^{−1} − 2 (x − 4)^{−1} August 14, 2001

6 The future...

The author hopes to maintain a website of maple worksheets which others have generated using the TEXtools package. Therefore the author requests that you submit any worksheets you produce to the website. Hopefully we will be able to provide a useful resource for all using the TEXtools package. Remember to check the website occasionally for package updates and worksheets. COMING SOON... tools for putting maple plots into L^{A}TEX files easily. In fact, a very primitive version of this has been implemented in this version (AddPlotToQs). However, not only is it primitive it doesn’t seem to work if the maple interface variable printlevel is not set to 15 or greater. I can’t determine why this should be the case and maybe this is a maple bug. Any suggestions...