# Finding the $\mathcal Z$-transform of $((-\frac{1}{3})^n + \frac{1}{2})^n \mu[n-2]$?

What is the $\mathcal Z$-transform of $\left(\left(-\frac{1}{3}\right)^n + \frac{1}{2}\right)^n \mu[n-2]$?

Doing raw computations with large $n$ gives a sum of $0.6030$ which doesn't seem right, and I'm not sure how to manipulate the expression to get some clean result.

• Mathematica is not able to find a solution. Its output is $\frac{\mathcal{Z}_n\left[\left(\left(-\frac{1}{3}\right)^{n+2}+\frac{1}{2}\right)^{n+2}\right](z)}{z^2}$ where $\mathcal{Z}_n$ denotes the Z-Transform with regard to $n$. – Maximilian Matthé Dec 21 '16 at 8:47

Since $\left| -\frac{1}{3}\right|< \frac{1}{2}$ and $n$ starts at $2$, one can think about an approximation based on the first terms of the polynomial development of $a_n = \left(\frac{1}{2}\right)^n\left(1+2\left(-\frac{1}{3}\right)^n\right)^n$. Using a binomial (polynomial) development up to degree $2$ on the second term only, one gets:

$$a_n \approx b_n= \left(\frac{1}{2}\right)^n + 2n\left(-\frac{1}{6}\right)^n + 2n(n-1)\left(\frac{1}{18}\right)^n \,.$$

Details: since coefficients are zero for $n<2$, for $n=2$,

$$a_2=\left(1+2\left(-\frac{1}{3}\right)^2\right)^2= b_2 = 1+ {2 \choose 1}\left(2\left(-\frac{1}{3}\right)\right)+ {2 \choose 2}\left(2\left(-\frac{1}{3}\right)\right)^2$$

exactly. Then for $n>2$, the term $c_n=2\left(-\frac{1}{3}\right)^n$ tends to be small. You can approximate $(1+c_n)^n$ by $1+ {n \choose 1}c_n+ {n \choose 2}c_n^2$.

The following graphs provide an evaluation of the approximation, up to $n=8$. Top graph superimposes $a_n$, @MaximilianMatthé's approximation (MM), and what we get using the first (D0), the first two (D1), or the three terms (D2) of the above series. $D0$ (only $\left(\frac{1}{2}\right)^n$) is clearly insufficient. The others are quite close. The bottom graph shows the absolute approximation errors. As you can see, $D1$ and $D2$ converge very fast when $n$ grows, and are already quite good for the first terms.

The nice thing with these approximations is that you not only reuse the classical properties of the $\mathcal{Z}$-transform: linearity, time-shift and scaling, but also differentiation (up to order $2$), because of the factors $n$ and $n(n-1)$:

$$n x_n \to -z\frac{dX(z)}{dz}\,.$$

A Matlab code for reproduction:

n = (2:8)';
s = ((-1/3).^n+1/2).^n;
s0 = ((-1/3).^n+(1/2).^n);
sa = ((1/2).^n);
sb = ((1/2).^n).*(1+2.*n.*(-1/3).^n);
sc = (1/2).^n+2.*n.*(-1/6).^n + 2.*n.*(n-1).*((1/18).^n);

subplot(2,1,1)
plot(n,[s,s0,sa,sb,sc],'.-');axis([0 max(n) -Inf Inf]); grid on
legend('Orig.','MM','D0','D1','D2')
h=xlabel('$n$ index');set(h,'INterpreter','latex');title('Series')
subplot(2,1,2)
semilogy(n,abs([nan(size(s)),s0-s,sa-s,sb-s,sc-s]),'.-');axis([0 max(n) -Inf Inf]); grid on
legend('Orig.','MM','D0','D1','D2')
h=xlabel('$n$ index');set(h,'INterpreter','latex');title('Absolute approximation errors')

• Thanks, that's a more systematic approach than my idea. I have a concern: In your first expression of $a_n$, shouldn't it contain $(1/2)^n$ and not just $(1/2)$? Also, what polynomial expansion are you referring to? I thought of Taylor, but it's not I think. – Maximilian Matthé Dec 21 '16 at 18:19
• Your first concern is legitimate. I put the parentheses around $1/2$ and forgot the exponent. Corrected. For the expansion: I approximate $(1+c_n)^n$, with $c_n$ small and $n\ge2$ as $1+ {n \choose 1}c_n+ {n \choose 2}c_n^2$. The expression is thus exact for $n=2$. I don't believe it is a valid Taylor, because $c_n$ depends on $n$, and I forgot a lot about these topics. Just a binomial expansion. – Laurent Duval Dec 21 '16 at 18:47

If you allow an approximate solution: You can try to approximate your series with a simpler series, where the $\mathcal Z$-Transform is readily available. For example, you can approximate your serios with:

$$x[n] = \left(\left(-\frac{1}{3}\right)^n+\frac{1}{2}\right)^n\cdot\mu[n-2]\approx \left(\left(\frac{1}{2}\right)^n + \left(\frac{-1}{3}\right)^n\right)\cdot\mu[n-2]=y[n]$$

I dont know, if this can be shown analytically, but you can show the approximation fits quite well numerically:

f = lambda n: np.real((1/2.+(-1/3.)**n)**n * (n>=2).astype(int))  # Your original series
part1 = lambda n: ((1/2.))**n * (n>=2).astype(int)
part2 = lambda n: ((-1/3)**n) * (n >=2).astype(int)

t = np.linspace(0, 15, 200).astype(complex)
n = np.arange(int(max(t)))

plt.plot(np.real(t.real), np.real(f(t)), label='original')
plt.stem(n, f(n), 'bo')
plt.stem(n, part1(n)+part2(n), 'ro')

plt.ylim((-0.2,0.45));


The red dots are the approximation, the blue curve/dots are the exact sequence. Then, the $\mathcal Z$-transform of this simpler series would be

$$\mathcal Z\left\{y[n]\right\}=\frac{-5 z^2+2 z+1}{6 (z-1)^2 z (2 z-1)}$$

You can also play around with the approximation to add more terms/change parameters to finally find something that fits your use case.