Given a Boolean function $f: B^n \longrightarrow B$, using Shannon's expansion across variable $x$, I can write it as $f = xf_x + x^{'}f_{x^{'}}$. I want to complement $f$. Using Shannon's expansion of $f^{'}$ directly, I can write $$f^{'} = xf^{'}_x + x^{'}f^{'}_{x^{'}}$$ However, if I complement $f = xf_x + x^{'}f_{x^{'}}$, using DeMorgan's laws, I get $$f^{'} = xf^{'}_x + x^{'}f^{'}_{x^{'}} + (f_x + f_{x^{'}})^{'}$$ Where am I going wrong?
Thanks.
Edit: If it helps in detecting the error (if it is there), here is how I obtained $f^{'}$ using DeMorgan's law:
$$f^{'} = (x f_x + x^{'} f_{x^{'}})^{'} = (x f_x)^{'}(x^{'} f_{x^{'}})^{'}$$ $$= (x^{'} + (f_x)^{'})(x + (f_{x^{'}})^{'})$$ Since $(f_x)^{'} = f^{'}_x$, $$f^{'} = (x^{'} + f^{'}_x)(x + f^{'}_{x^{'}}) = x^{'}x + x^{'} f^{'}_{x^{'}} + x f^{'}_x + f^{'}_x f^{'}_{x^{'}}$$ $$f^{'} = x f^{'}_x + x^{'} f^{'}_{x^{'}} + (f_x + f_{x^{'}})^{'}$$
New answer
I think now I got the point. Consider $$f^{'} = x f^{'}_x + x^{'} f^{'}_{x^{'}} + f^{'}_x f^{'}_{x^{'}}.$$
Let's write this using the Shannon's expansion:
$$f^{'}(x=1) = f^{'}_x + f^{'}_x f^{'}_{x^{'}} = f^{'}_x (1+f^{'}_{x^{'}})=f^{'}_x,$$
and
$$f^{'}(x=0) = f^{'}_{x^{'}} + f^{'}_x f^{'}_{x^{'}} = f^{'}_{x^{'}} (1+f^{'}_{x})=f^{'}_{x^{'}}.$$
Therefore:
$$f' = x f^{'}(x=1) + x' f^{'}(x=0) = xf^{'}_x + x^{'}f^{'}_{x^{'}}.$$
Note: so it's not that $(f_x + f_{x^{'}})^{'}$ is always $0$, it's that it is covered by $x f^{'}_x + x^{'} f^{'}_{x^{'}}$.
Old (and bad) answer
You are ok. Just notice that:
$$f_x + f_{x^{'}}$$
is always true and
$$(f_x + f_{x^{'}})^{'}$$
is always false. Then:
$$f^{'} = xf^{'}_x + x^{'}f^{'}_{x^{'}_i} + (f_x + f_{x^{'}})^{'} = xf^{'}_x + x^{'}f^{'}_{x^{'}_i}.$$