---
title: "Difference equation with step input"
subject: "Digital Control System"
chapter: 2
key: "semester_6/digital_control_system:difference-equation-step-0-25"
source: https://www.bctengineer.com/q/semester_6/digital_control_system/difference-equation-step-0-25
site: BCT Engineering
---

# Difference equation with step input

Digital Control System · Chapter 2: The Z-Transform

- Asked in: 2080 Chaitra, 8 marks; 2073 Bhadra, 8 marks (asked 2 times)
- Video: [SOLUTION OF DIFFERENCE EQUATION](https://www.youtube.com/watch?v=1KuWLNN2SKw) — Department of EC SIRT Bhopal
- 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-step-0-25
- Whole chapter: https://www.bctengineer.com/md/semester_6/digital_control_system/chapter-2

## Question

Solve the given difference equation and hence determine the output x(k), if u(t) is a unit step input function and x(t) is an output function: x(k+2)-x(k+1)+0.25x(k)=u(k+2), where x(0)=1 and x(1)=2.

## Short answer

Solve x(k+2)-x(k+1)+0.25x(k)=u(k+2) with x(0)=1, x(1)=2, u(k)=1. Z-transform yields X(z)=z³/((z-1)(z-0.5)²). Inverse gives x(k)=4-(k+3)(0.5)^k, settling at 4.

## Answer

Given $x(k+2) - x(k+1) + 0.25x(k) = u(k+2)$, $x(0)=1$, $x(1)=2$, $u(k) = 1$ for $k \ge 0$.

#### Step 1: z-transform of both sides

Shifting theorems:
$\mathcal{Z}[x(k+2)] = z^2X(z) - z^2x(0) - zx(1)$, $\mathcal{Z}[x(k+1)] = zX(z) - zx(0)$.

Right side: $u(k+2) = 1$ for all $k \ge 0$, so $\mathcal{Z}[u(k+2)] = z^2U(z) - z^2u(0) - zu(1) = \frac{z^3}{z-1} - z^2 - z = \frac{z}{z-1}$.

Left side:

$$
\begin{aligned}
&[z^2X - z^2(1) - z(2)] - [zX - z(1)] + 0.25X \\
&= (z^2 - z + 0.25)X(z) - z^2 - z
\end{aligned}
$$

#### Step 2: solve for $X(z)$

$$
\begin{aligned}
(z-0.5)^2X(z) &= z^2 + z + \frac{z}{z-1} = \frac{(z^2+z)(z-1) + z}{z-1} = \frac{z^3}{z-1} \\
X(z) &= \frac{z^3}{(z-1)(z-0.5)^2}
\end{aligned}
$$

#### Step 3: inverse by residues of $X(z)z^{k-1} = \frac{z^{k+2}}{(z-1)(z-0.5)^2}$

At $z = 1$:
$$
K_1 = \left.\frac{z^{k+2}}{(z-0.5)^2}\right|_{z=1} = \frac{1}{0.25} = 4
$$

At $z = 0.5$ (double pole):

$$
\begin{aligned}
K_2 &= \left.\frac{d}{dz}\left[\frac{z^{k+2}}{z-1}\right]\right|_{z=0.5} = \left.\frac{z^{k+1}[(k+2)(z-1) - z]}{(z-1)^2}\right|_{z=0.5} \\
&= \frac{0.5^{k+1}[-0.5(k+2) - 0.5]}{0.25} = -2(0.5)^{k+1}(k+3) \\
&= -(k+3)(0.5)^k
\end{aligned}
$$

#### Result

$$
x(k) = 4 - (k+3)(0.5)^k, \quad k = 0, 1, 2, \dots
$$

#### Check with the recursion $x(k+2) = x(k+1) - 0.25x(k) + 1$

| k | 0 | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|---|
| Formula | 1 | 2 | 2.75 | 3.25 | 3.5625 | 3.75 | 3.8594 |
| Recursion | 1 | 2 | 2.75 | 3.25 | 3.5625 | 3.75 | 3.8594 |

Final value: $\lim_{z\to1}(z-1)X(z) = 1/0.25 = 4$, which matches $x(\infty) = 4$.

**Answer:** $x(k) = 4 - (k+3)(0.5)^k$; the output rises from 1 and settles at 4.

## Check yourself

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

1. Z[u(k+2)] for a unit step is:
   A. z^3/(z-1)
   B. 1/(z-1)
   C. z^2/(z-1)
   D. z/(z-1)
   Answer: D. z^3/(z-1) - z^2 - z = z/(z-1). (Key point: Right side)

2. X(z) =
   A. z^3/((z-1)(z-0.5)^2)
   B. z/((z-1)(z-0.5)^2)
   C. z^2/((z-1)(z-0.5))
   D. z^3/((z-1)(z+0.5)^2)
   Answer: A. (z-0.5)^2 X = z^3/(z-1). (Key point: X(z))

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

4. The output settles at:
   A. 1
   B. 2
   C. 4
   D. 0.25
   Answer: C. 1/0.25 = 4. (Key point: Final value)

## Related in Digital Control System

- [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 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×
- [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
- [Z-transform of k² e^(−ak) from unit step](https://www.bctengineer.com/question.md?key=semester_6%2Fdigital_control_system%3Az-transform-k2-e-ak) — 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
- [Random process; LTI output is WSS if input is WSS](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Arandom-process-lti-wssp) — Communication Systems, chapter 9
- [Input/output interface unit design factors](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Aio-interface-unit-importance) — Instrumentation II, chapter 7
- [Need for difference equation; LCCDE and system function](https://www.bctengineer.com/question.md?key=semester_7%2Fdigital_signal_analysis_and_processing%3Awhy-difference-equation-lccde) — Digital Signal Analysis and Processing, chapter 1, asked 2×
