# Selecting the positive solution only

This my first problem on Mathematica and I'm working on version 13.0, and I want to get the inverse z transform for an equation, It works fine but it gives me the solution in the positive and negative part of the real x axis.

My question is how to make it gives only the solution in the positive part of the x axis.

• "how to make it gives only the solution in the positive part of the x axis." Notice that UnitStep[1 - k]* UnitStep[k - 1]=0 So you only have the term with UnitStep[-2 + k] which makes the solution start at k>2 and zero for k<=2. Jan 1, 2022 at 18:24
• @Nasser - Assuming[Element[k, Integers], UnitStep[1 - k]*UnitStep[k - 1] // FullSimplify] evaluates to DiscreteDelta[-1 + k] since UnitStep[0] == 1 Jan 1, 2022 at 18:32
• Please post your Mathematica code here. Picture is not so useful. Jan 2, 2022 at 5:19

## 1 Answer

Clear["Global*"]


I am guessing that your e is actually meant to be E

f[z_] = (1 - E^-t) (2 z - 1)/((z - 1) (z - E^-t));


Note that InverseZTransform takes the option Assumptions

Options[InverseZTransform]

(* {Assumptions :> \$Assumptions, Method -> Automatic} *)


Then,

Assuming[k >= 0, InverseZTransform[f[z], z, k] // FullSimplify]

(* Piecewise[{{2 - 2/E^t, k == 1},
{1 + (-2 + E^t)/E^(k*t), k >= 2}}, 0] *)
`