## Discrete Mathematics: Total Solution of Non-Homogeneous Linear Difference Equations

In the field of discrete mathematics, a non-homogeneous linear difference equation is an equation that relates a sequence of values to their previous values, where the equation includes a non-zero constant term. These equations are commonly used to model various phenomena in computer science, economics, physics, and other disciplines.

## Understanding Non-Homogeneous Linear Difference Equations

A non-homogeneous linear difference equation can be represented in the form:

**a _{n}** =

**c**

_{1}a_{n-1}+ c_{2}a_{n-2}+ … + c_{k}a_{n-k}+ g(n)Where:

**a**represents the value of the sequence at position n_{n}**c**are constants_{1}, c_{2}, …, c_{k}**g(n)**is a function that represents the non-zero constant term

The goal is to find the total solution, which is a function that satisfies the equation for all values of n. The total solution can be divided into two parts: the complementary function and the particular solution.

## Complementary Function

The complementary function, also known as the homogeneous solution, is the solution to the associated homogeneous equation:

**a _{n} = c_{1}a_{n-1} + c_{2}a_{n-2} + … + c_{k}a_{n-k}**

To find the complementary function, we assume that **a _{n} = r^{n}**, where r is an unknown constant. Substituting this assumption into the homogeneous equation, we get:

**r ^{n} = c_{1}r^{n-1} + c_{2}r^{n-2} + … + c_{k}r^{n-k}**

By rearranging the terms, we obtain a characteristic equation:

**r ^{k} – c_{1}r^{k-1} – c_{2}r^{k-2} – … – c_{k} = 0**

Solving this equation will give us the values of r, which are the roots of the equation. The complementary function is then given by:

**a _{n} = A_{1}r_{1}^{n} + A_{2}r_{2}^{n} + … + A_{k}r_{k}^{n}**

Where A_{1}, A_{2}, …, A_{k} are constants determined by the initial conditions of the sequence.

## Particular Solution

The particular solution is a function that satisfies the non-homogeneous equation. To find the particular solution, we use a method called the method of undetermined coefficients or the method of variation of parameters.

In the method of undetermined coefficients, we assume that the particular solution has the same form as the non-zero constant term **g(n)**. We substitute this assumed form into the non-homogeneous equation and solve for the coefficients.

In the method of variation of parameters, we assume that the particular solution has the form:

**a _{n} = u_{1}(n)a_{1}^{n} + u_{2}(n)a_{2}^{n} + … + u_{k}(n)a_{k}^{n}**

Where u_{1}(n), u_{2}(n), …, u_{k}(n) are unknown functions. We substitute this assumed form into the non-homogeneous equation and solve for the unknown functions.

## Example: Total Solution of a Non-Homogeneous Linear Difference Equation

Let’s consider the following non-homogeneous linear difference equation:

**a _{n} = 2a_{n-1} – a_{n-2} + 3n**

To find the total solution, we first solve the associated homogeneous equation:

**a _{n} = 2a_{n-1} – a_{n-2}**

The characteristic equation is:

**r ^{2} – 2r + 1 = 0**

Factoring the equation, we get:

**(r – 1)(r – 1) = 0**

So, the root of the characteristic equation is r = 1. The complementary function is:

**a _{n} = A_{1}(1)^{n} + A_{2}(n)(1)^{n}**

Next, we find the particular solution using the method of undetermined coefficients. Since the non-zero constant term is 3n, we assume that the particular solution has the form **a _{p} = An + B**. Substituting this into the non-homogeneous equation, we get:

**An + B = 2(An-1 + B) – (An-2 + B) + 3n**

Simplifying the equation, we obtain:

**An + B = 2An – 2A + 2B – An-2 – B + 3n**

By comparing the coefficients of n and the constants, we get:

**A = 1**

**B = -2**

Therefore, the particular solution is:

**a _{p} = n – 2**

The total solution is the sum of the complementary function and the particular solution:

**a _{n} = A_{1}(1)^{n} + A_{2}(n)(1)^{n} + n – 2**

Where A_{1} and A_{2} are constants determined by the initial conditions of the sequence.

## Conclusion

In summary, a non-homogeneous linear difference equation is an equation that relates a sequence of values to their previous values, with a non-zero constant term. The total solution of a non-homogeneous linear difference equation consists of the complementary function, which is the solution to the associated homogeneous equation, and the particular solution, which satisfies the non-homogeneous equation. By finding the roots of the characteristic equation and solving for the coefficients in the particular solution, we can determine the total solution. Understanding the total solution of non-homogeneous linear difference equations is essential in various fields of study, as it allows us to model and analyze real-world phenomena.