---
title: "Difference equation with u(K+1) and u(K) step inputs"
subject: "Digital Control System"
chapter: 2
key: "semester_6/digital_control_system:difference-equation-two-inputs-step"
source: https://www.bctengineer.com/q/semester_6/digital_control_system/difference-equation-two-inputs-step
site: BCT Engineering
---

# Difference equation with u(K+1) and u(K) step inputs

Digital Control System · Chapter 2: The Z-Transform

- Asked in: 2068 Magh, 8 marks
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/digital_control_system/difference-equation-two-inputs-step
- Whole chapter: https://www.bctengineer.com/md/semester_6/digital_control_system/chapter-2

## Question

Solve the following difference equation: x(K+2)-1.379x(K+1)+0.3679x(K)=0.3679u(K+1)+0.2642u(K), where u(K) is input which has initial values x(0)=0, x(1)=0.3679, u(K)=1 for K≥ 0.

## Short answer

Assuming the intended coefficient is 1.3679, apply z-transform with given initial conditions and step input U(z)=z/(z-1). Solve for X(z) and expand in partial fractions. The solution is x(k)=k-1+(0.3679)^k = k-1+e^{-k} for k≥0.

## Answer

**Assumption:** the coefficient "1.379" is read as **1.3679**. This is the standard textbook equation, where $1.3679 = 1 + e^{-1}$ and $0.3679 = e^{-1}$, and it agrees with the given $x(1) = 0.3679$. A note at the end gives the values for 1.379 as printed.

#### Step 1: Z-transform with initial conditions

Use $\mathcal{Z}[x(k+2)] = z^2X - z^2x(0) - zx(1)$, $\mathcal{Z}[x(k+1)] = zX - zx(0)$, and $\mathcal{Z}[u(k+1)] = zU - zu(0)$. Substitute $x(0) = 0$, $x(1) = 0.3679$, $u(0) = 1$:

$$
z^2X - 0.3679z - 1.3679zX + 0.3679X = 0.3679zU - 0.3679z + 0.2642U
$$

The $-0.3679z$ terms on both sides cancel:

$$
X(z)\,(z^2 - 1.3679z + 0.3679) = (0.3679z + 0.2642)\,U(z)
$$

#### Step 2: Substitute the step input $U(z) = \dfrac{z}{z-1}$

$z^2 - 1.3679z + 0.3679 = (z-1)(z-0.3679)$, so

$$
X(z) = \frac{z(0.3679z + 0.2642)}{(z-1)^2(z-0.3679)}
$$

#### Step 3: Partial fractions of $X(z)/z$

$$
\frac{X(z)}{z} = \frac{0.3679z + 0.2642}{(z-1)^2(z-0.3679)} = \frac{A}{(z-1)^2} + \frac{B}{z-1} + \frac{C}{z-0.3679}
$$

$$
\begin{aligned}
A &= \left[\frac{0.3679z + 0.2642}{z - 0.3679}\right]_{z=1} = \frac{0.6321}{0.6321} = 1 \\
C &= \left[\frac{0.3679z + 0.2642}{(z-1)^2}\right]_{z=0.3679} = \frac{0.1354 + 0.2642}{(0.6321)^2} = \frac{0.3996}{0.3996} = 1 \\
B &= \frac{d}{dz}\left[\frac{0.3679z + 0.2642}{z - 0.3679}\right]_{z=1} = \left[\frac{0.3679(z-0.3679) - (0.3679z+0.2642)}{(z-0.3679)^2}\right]_{z=1} = \frac{-0.3996}{0.3996} = -1
\end{aligned}
$$

$$
X(z) = \frac{z}{(z-1)^2} - \frac{z}{z-1} + \frac{z}{z - 0.3679}
$$

#### Step 4: Inverse transform

Using $\dfrac{z}{(z-1)^2} \to k$, $\dfrac{z}{z-1} \to 1$, $\dfrac{z}{z-e^{-1}} \to e^{-k}$:

$$
x(k) = k - 1 + (0.3679)^k = k - 1 + e^{-k}, \quad k = 0, 1, 2, \dots
$$

#### Step 5: Check

| $k$ | 0 | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|---|
| Formula | 0 | 0.3679 | 1.1353 | 2.0498 | 3.0183 | 4.0067 |
| Recursion | 0 | 0.3679 | 1.1354 | 2.0498 | 3.0183 | 4.0067 |

The recursion is $x(k+2) = 1.3679x(k+1) - 0.3679x(k) + 0.6321$. The two agree to rounding. The double pole at $z = 1$ makes the output grow like a ramp ($x(k) \approx k - 1$ for large $k$). This is the step response of an open-loop system containing an integrator.

#### Note: with 1.379 as printed

The recursion $x(k+2) = 1.379x(k+1) - 0.3679x(k) + 0.6321$ gives $0, 0.3679, 1.1394, 2.0680, 3.0647, 4.0975, \dots$. The roots of $z^2 - 1.379z + 0.3679$ are then $z = 1.0174$ and $0.3616$, so the output grows slightly faster than a ramp.

**Answer (1.3679):** $x(k) = k - 1 + e^{-k} = k - 1 + (0.3679)^k$ for $k \ge 0$.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What is Z[x(k+2)] with initial values x(0), x(1)?
   A. z^2 X - z^2 x(0) - z x(1)
   B. z^2 X - z x(0) - x(1)
   C. z^2 X + z^2 x(0) + z x(1)
   D. z^2 X
   Answer: A. The shift theorem for an advance subtracts the initial-value terms. (Key point: Transform of shifted terms)

2. With 1.3679 read for 1.379, z^2 - 1.3679z + 0.3679 factors as:
   A. (z-1)(z-0.3679)
   B. (z+1)(z+0.3679)
   C. (z-1)^2
   D. (z-0.3679)^2
   Answer: A. 1 + 0.3679 = 1.3679 and 1 x 0.3679 = 0.3679. (Key point: Factorised denominator)

3. Why does X(z) = z(0.3679z+0.2642)/((z-1)^2(z-0.3679)) give a ramp-like output?
   A. The double pole at z = 1 gives a term z/(z-1)^2, which inverts to k
   B. The pole at 0.3679 grows
   C. The input is a ramp
   D. The zeros cancel the poles
   Answer: A. The double pole at z=1 yields k, so x(k) grows like k - 1 for large k. (Key point: Repeated pole at z = 1)

4. What is x(k)?
   A. k - 1 + (0.3679)^k
   B. k + 1 - (0.3679)^k
   C. 1 - (0.3679)^k
   D. k - 1 - (0.3679)^k
   Answer: A. Partial fractions give A = 1, B = -1, C = 1, so x(k) = k - 1 + e^{-k}; check x(0) = 0, x(1) = 0.3679. (Key point: Final solution)

## Related in Digital Control System

- [Difference equation with step input, x(1)=0.3679](https://www.bctengineer.com/question.md?key=semester_6%2Fdigital_control_system%3Adifference-equation-step-0-3679) — Digital Control System, chapter 2, asked 2×
- [Difference equation with step input](https://www.bctengineer.com/question.md?key=semester_6%2Fdigital_control_system%3Adifference-equation-step-0-25) — Digital Control System, chapter 2, asked 2×
- [Difference equation with given input sequence](https://www.bctengineer.com/question.md?key=semester_6%2Fdigital_control_system%3Adifference-equation-given-inputs) — Digital Control System, chapter 2, asked 2×
- [Difference equation with input u(2) = −0.2142](https://www.bctengineer.com/question.md?key=semester_6%2Fdigital_control_system%3Adifference-equation-given-inputs-neg) — Digital Control System, chapter 2, asked 2×
- [Backward difference equation with step input](https://www.bctengineer.com/question.md?key=semester_6%2Fdigital_control_system%3Adifference-equation-backward-step) — Digital Control System, chapter 2

## Related in other subjects

- [Difference eq with unit step input](https://www.bctengineer.com/question.md?key=semester_4%2Fapplied_mathematics%3Adifference-eq-unit-step) — Applied Mathematics, chapter 2
