---
title: "Difference eq with unit step input"
subject: "Applied Mathematics"
chapter: 2
key: "semester_4/applied_mathematics:difference-eq-unit-step"
source: https://www.bctengineer.com/q/semester_4/applied_mathematics/difference-eq-unit-step
site: BCT Engineering
---

# Difference eq with unit step input

Applied Mathematics · Chapter 2: The Z-Transform

- Asked in: 2068 Bhadra
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_4/applied_mathematics/difference-eq-unit-step
- Whole chapter: https://www.bctengineer.com/md/semester_4/applied_mathematics/chapter-2

## Question

Solve the difference equation x(k + 2) - x(k + 1) + 0.25x(k) = u(k) where x(0) = 1 and x(1) = 2 and u(k) is unit step function.

## Short answer

Using z-transform with U(z)=z/(z-1), X(z)=z^3/[(z-1)(z-1/2)^2]. Inversion gives x(k)=4-(k+3)(1/2)^k.

## Answer

**Equation:** x(k + 2) − x(k + 1) + 0.25x(k) = u(k), x(0) = 1, x(1) = 2, with u(k) = 1 for k ≥ 0, so Z[u(k)] = z/(z − 1).

**Step 1: z-transform.**

```text
[z²X − z² − 2z] − [zX − z] + 0.25X = z/(z − 1)
(z² − z + 0.25) X = z² + z + z/(z − 1)
(z − ½)² X = z³ / (z − 1)           (since (z²+z)(z−1) + z = z³)
X(z) = z³ / [(z − 1)(z − ½)²]
```

**Step 2: partial fractions.**

X/z = z² / [(z − 1)(z − ½)²] = A/(z − 1) + B/(z − ½) + C/(z − ½)²

```text
A = 1²/(1 − ½)²                    = 4
C = (½)²/(½ − 1)                   = −1/2
B: d/dz [z²/(z−1)] at z = ½
   = (z² − 2z)/(z − 1)² = (¼ − 1)/¼ = −3
(check: A + B = 1, the z² coefficient ✓)
```

X(z) = 4 z/(z − 1) − 3 z/(z − ½) − ½ z/(z − ½)²

**Step 3: inverse.** Z⁻¹[z/(z − a)²] = k a^{k−1}, so −½ · k (½)^{k−1} = −k (½)ᵏ.

x(k) = 4 − 3(½)ᵏ − k(½)ᵏ

**Answer:** x(k) = 4 − (k + 3)(½)ᵏ, k ≥ 0.

Check: x(0) = 4 − 3 = 1 ✓, x(1) = 4 − 4/2 = 2 ✓, x(2) = 4 − 5/4 = 2.75 (recurrence: 2 − 0.25 + 1 = 2.75 ✓), x(3) = 3.25 ✓. As k → ∞, x(k) → 4 (steady state).

## Check yourself

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

1. Z[u(k)] =
   A. z/(z-1)
   B. 1
   C. z/(z+1)
   D. 1/(z-1)
   Answer: A. Unit step. (Key point: Forcing)

2. Combining gives X(z) =
   A. z^2/[(z-1)(z-1/2)]
   B. z^3/[(z-1)(z-1/2)^2]
   C. z/[(z-1)(z-1/2)^2]
   D. z^3/[(z-1)^2(z-1/2)]
   Answer: B. (z^2 - z + 0.25) = (z-1/2)^2. (Key point: Transform)

3. The z^2 + z terms come from
   A. the unit step
   B. the roots
   C. x(0)=1 and x(1)=2 in the shift formulas
   D. dividing by z
   Answer: C. z^2 + 2z - z = z^2 + z. (Key point: Initial values)

4. x(k) =
   A. 4 + (k+3)(1/2)^k
   B. 4 - 3(1/2)^k
   C. 1 - (k+3)(1/2)^k
   D. 4 - (k+3)(1/2)^k
   Answer: D. x(0)=1, x(1)=2; tends to 4. (Key point: Result)

## Related in Applied Mathematics

- [Difference eq x(k+2)+2x(k+1)+3x(k)=0](https://www.bctengineer.com/question.md?key=semester_4%2Fapplied_mathematics%3Adifference-eq-2x1-3x-x0-0-x1-2) — Applied Mathematics, chapter 2, asked 5×
- [Difference eq x(k+2)-4x(k+1)+4x(k)=2^k](https://www.bctengineer.com/question.md?key=semester_4%2Fapplied_mathematics%3Adifference-eq-forced-2k-4) — Applied Mathematics, chapter 2, asked 5×
- [Difference eq x(k+2)+6x(k+1)+9x(k)=2^k](https://www.bctengineer.com/question.md?key=semester_4%2Fapplied_mathematics%3Adifference-eq-forced-2k-9) — Applied Mathematics, chapter 2, asked 5×
- [Difference eq x(k+2)-4x(k+1)+4x(k)=0, x(0)=1](https://www.bctengineer.com/question.md?key=semester_4%2Fapplied_mathematics%3Adifference-eq-4x1-4x-x0-1-x1-0) — Applied Mathematics, chapter 2, asked 3×
- [Difference eq x(k+2)+3x(k+1)+2x(k)=0](https://www.bctengineer.com/question.md?key=semester_4%2Fapplied_mathematics%3Adifference-eq-3x1-2x-x0-0-x1-1) — Applied Mathematics, chapter 2, asked 3×
- [Difference eq x(k+2)-4x(k+1)+4x(k)=0, x(0)=0](https://www.bctengineer.com/question.md?key=semester_4%2Fapplied_mathematics%3Adifference-eq-4x1-4x-x0-0-x1-1) — Applied Mathematics, chapter 2, asked 2×

## Related in other subjects

- [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×
- [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
- [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 u(K+1) and u(K) step inputs](https://www.bctengineer.com/question.md?key=semester_6%2Fdigital_control_system%3Adifference-equation-two-inputs-step) — Digital Control System, chapter 2
