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^{'}})^{'}$$