Linearity
So a system is linear if its inputs x1(t), x2(t) or (x1[n], x2[n] for Discrete Time signals) yield outputs y1(t), y2(t) such as the response: a*x1(t)+b*x2(t) => a*y1(t)+b*y2(t).
Example: Linear
One-Way
x1(t) -> [sys] -> y1(t) = cos(t) -> (X)*a +++
= a*cos(t)+b*sin(t) = z(t)
x2(t) -> [sys] -> y2(t) = sin(t) -> (X)*b +++
Reverse-Way
cos(t) = x1(t)*a +++
= a*cos(t)+b*sin(t) -> [sys] -> w(t)= a*cos(t)+b*sin(t)
sin(t) = x2(t)*b +++
since w(t) = z(t) then the inputs are the same as the outputs which makes this a linear system.
Example: Non-Linear
One-way
y[n] = 2*x[n]^3
x1[n] -> [sys] -> y1[n]=2*x1[n]^3 -> (X)*a +++
= a*2*x1[n]^3+2*b*x2[n]^3
x2[n] -> [sys] -> y2[n]=2*x2[n]^3 -> (X)*b +++
Reverse-way
x1[n] -> (X)*a +++
= a*x1[n]+b*x2[n] -> [sys] -> 2*z[n]^3 = 2*(a*x1[n] + b*x2[n])^3
x2[n] -> (X)*b +++
However, since 2*a*x1[n]^3 + 2*b*x2[n] != 2(a*x1[n] + b*x2[n])^3 = 8*a^3*x1[n]^3 + 8*b^3*x2[n]^3
the system is not linear because the two inflexive operations are not equal to each other.