Table of Contents Author Guidelines Submit a Manuscript
Mathematical Problems in Engineering
Volume 2008, Article ID 654820, 7 pages
Research Article

Resolution of First- and Second-Order Linear Differential Equations with Periodic Inputs by a Computer Algebra System

1Departamento de Matemática Aplicada, Centro Politécnico Superior (CPS), Universidad de Zaragoza, 50015 Zaragoza, Spain
2Departamento de Matemática Aplicada, Escuela Técnica Superior de Ingenieros Agrónomos (ETSIA), and (IUMPA), Universidad Politécnica de Valencia, 46022 Valencia, Spain
3Departamento de Matemática Aplicada, Escuela Técnica Superior de Ingeniería del Diseño (ETSID), and Instituto Universitario de Matemática Pura y Aplicada (IUMPA), Universidad Politécnica de Valencia, 46022 Valencia, Spain

Received 16 June 2008; Accepted 26 July 2008

Academic Editor: Carlo Cattani

Copyright © 2008 M. Legua et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.


In signal processing, a pulse means a rapid change in the amplitude of a signal from a baseline value to a higher or lower value, followed by a rapid return to the baseline value. A square wave function may be viewed as a pulse that repeats its occurrence periodically but the return to the baseline value takes some time to happen. When these periodic functions act as inputs in dynamic systems, the standard tool commonly used to solve the associated initial value problem (IVP) is Laplace transform and its inverse. We show how a computer algebra system may also provide the solution of these IVP straight forwardly by adequately introducing the periodic input.

1. Introduction

Linear differential equations where is a known input and is the -order linear differential operator, are easily solved when it has got constant coefficients , the roots of the homogeneous associated equation are known, and the input is an adequate combination of exponential, cosine, sine, and polynomial functions.

A different situation arises when, even the coefficients being constants, the input is a periodic function which may fail to be continuous or may be formed by a sequence of pulses. In this case, two widely used methods to handle the problem are Fourier series and Laplace transforms [1, 2]. Both methods require to know their properties which on the other hand are highly rewarding since they can help to solve some partial differential equations, too.

The proliferation in the use of computer algebra systems has facilitated and fastened obtaining some of these solutions. In this note, we show how some of them, namely DERIVE [3], may directly provide the solution of first- and second-order differential equations in the presence of periodic inputs.

2. Generating Periodic Functions

Let us recall that a function is called periodic with period if for all in the domain of the function . Geometrically, this means that the graph of repeats itself every units. Periodic functions do appear in a number of real-life situations such as alternating currents, the motion of a pendulum, vibrations of a spring, and sound waves, just to mention a few of them.

Computer algebra systems allow an easy representation of periodic functions since they have usually got an implemented command which enables to find the remainder on an integer division of two real numbers. With this goal, assume that we have a given function defined in and is to generate a -periodic function, which repeats the values of in successive intervals of length . Then, if DERIVE is the handy program, it will generate by just substituting the variable of by [4] MATHEMATICA [5] and MATLAB [6] programs enjoy similar capabilities by means of their corresponding commands (cf. [7]).

Example 2.1. Represent the -periodic function generated as a full-wave rectified sinusoid such that

Solution 1. The DERIVE program enables to introduce by writing Simplifying the above expression and plotting the generated function, we obtain the graph that appears in Figure 1.

Figure 1: Full-wave rectified sinusoid.

A similar graph is obtained with MATHEMATICA by introducing Plot(Sin(Mod(Pi, 0)), , PlotRange ), and with MATLAB by setting, ezplot.

From now on, we will focus on DERIVE which has also got a useful CHI function that is equally to in and vanishes outside this interval.

Example 2.2. Represent the -periodic function such that

Solution 2. Having in mind the above, we just have to introduce Simplifying the above expression and plotting the generated function, we obtain the graph that appears in Figure 2.

Figure 2: Square wave function.

Finally and for the sake of completeness, let us recall the following result which justifies that ext is a -periodic function which coincides with on . Its easy proof follows immediately noting that if for each real number denotes integer part function, that is, equals the integer number such that then for .

Lemma 2.3. If is a real-valued function defined over , then is a -periodic function defined over that coincides with in .

3. Initial Value Problems with Periodic Inputs

Let us now recall some DERIVE commands that enable to solve first- and second-order linear differential equations. Given a linear differential equation written in the form the command LINEAR1_GEN provides the general solution in terms of the symbolic constant The command LINEAR1 simplifies to the explicit solution for the initial condition at , there being other available commands for other specific kinds of differential equations (cf. [8]).

Let us also recall that DSOLVE2 provides the general solution of the second-order linear differential equation in terms of the symbolic constants and Analogously, is simplified to the explicit solution for the boundary value conditions at , and at , and to the explicit solution for the initial value conditions at , and at .

Next, we provide an example of a first- (and another of a second-) order linear differential equation with periodic inputs and show how the aforementioned commands can cope with periodic inputs.

Example 3.1. Considering as input the function of Example 2.2, solve

Solution 3. Let us combine the aforementioned implemented functions with the function defined in Example 2.2 by The general integral is obtained by simplifying Hence, we obtain the solution (note that the following expression giving is not corrupted. It is included exactly in the way provided by the computer algebra system since it has got a long fraction and its terms are continuously written throughout different lines), graph001(3.7) Making take a finite set of values, we get the corresponding particular solutions, for example, with the integer values between and 10, we obtain 21 particular solutions whose graphs are depicted in Figure 3.

Figure 3: Particular solutions.

In what concerns second-order differential equations, let us recall that the forced motion of a mass attached to a vibrating spring with damping constant and spring constant is modeled by where is an external force acting upon When the external force is identically equal to zero, the motion is called a free motion and it is well known that its solution (underdamped, critically damped, or overdamped) depends very heavily upon the nature of the characteristic roots. Next, we solve a problem where the external force is a wave square function (see [9, pages 336–341]).

Example 3.2. A mass of  g is attached to the end of a spring with  dyn/cm and the air resistance acts upon the mass with a force that is times its velocity at time . The mass has got no motion at its equilibrium position when it is subjected to an external periodic force equal to a square wave function of amplitude cm. Find the position of the mass.

Solution 4. In this case, the position is set by the initial value problem where is the -periodic depicted in Example 2.2. Thus the position is obtained by simplifying The solution provided by the computer algebra system (remember that long fraction terms are continuously written throughout different lines) is the following one, graph002(3.11) Its graph is plotted in Figure 4.

Figure 4: Position of the mass.

4. Conclusion

Laplace transform is an important tool classically used to solve initial value problems in the presence of a periodic external force. For its adequate use, properties of direct and inverse Laplace transforms are required and they are extensively studied in many textbooks.

In this paper, we have seen how DERIVE enables to avoid this in a very simple way. This is achieved by using its standard routines that provide the general solution of a differential equation and the exact solution of a given initial value problem, along with the possibility of handling periodic functions by means of its MOD command.

Finally, DERIVE facilitates to plot the solution and its evaluation at a given point if desired.


This work is supported by Spanish Ministry of Education projects MTM2005-01182 and DPI2005-08732-C02-01, with FEDER funds. The authors are grateful to the reviewers for their useful suggestions.


  1. R. J. Beerends, H. G. ter Morsche, J. C. van den Berg, and E. M. van de Vrie, Fourier and Laplace Transforms, Cambridge University Press, Cambridge, UK, 2003. View at Zentralblatt MATH · View at MathSciNet
  2. J. W. Brown and R. V. Churchill, Fourier Series and Boundary Value Problems, McGraw-Hill, New York, NY, USA, 1993.
  3. DERIVETM. The Mathematical Assistant for Your Personal Computer, Texas Instruments, Stafford, Tex, USA, 2000.
  4. M. Legua, J. A. Moraño, and L. M. Sánchez Ruiz, “Generating periodic functions,” WSEAS Transactions on Systems, vol. 3, no. 1, pp. 37–39, 2004. View at Google Scholar · View at Zentralblatt MATH
  5. S. Wolfram, The Mathematica® Book, Wolfram Media/Cambridge University Press, Cambridge, UK, 4th edition, 1999. View at Zentralblatt MATH · View at MathSciNet
  6. MATLAB®. The Language of Technical Computing, The MathWorks, Natick, Mass, USA, 2002.
  7. M. Legua, J. A. Moraño, and L. M. Sánchez Ruiz, “Sine and cosine series representations,” WSEAS Transactions on Mathematics, vol. 3, no. 3, pp. 543–548, 2004. View at Google Scholar · View at MathSciNet
  8. L. M. Sánchez Ruiz, M. Legua, and J. A. Moraño, Matemáticas con DERIVE, Universidad Politécnica de Valencia, Valencia, Spain, 2001.
  9. C. H. Edwards Jr. and D. E. Penney, Ecuaciones Diferenciales Elementales, Prentice Hall, Upper Saddle River, NJ, USA, 1993.