simplify boolean function
The error is in line 3. It should be like this:

$$\overline{(x_3+x_2)x_2} = \overline{(x_3+x_2)} + \overline{x_2} = \overline{x_3} \cdot \overline{x_2} + \overline{x_2} = \overline{x_2} (\overline{x_3} + 1) = \overline{x_2}$$

This gives you:

$$x_4x_2 + \overline{x_2} + x_2x_0 = x_2(x_4+x_0)+\overline{x_2}$$

To simplify this, we can write:

$$\overline{\overline{x_2(x_4+x_0)+\overline{x_2}}} = \overline{(\overline{x_2}+\overline{(x_4+x_0)}) \cdot x_2} = \overline{\overline{x_2}\cdot x_2 + \overline{(x_4+x_0)} \cdot x_2} =$$
$$= \overline{0+\overline{(x_4+x_0)} \cdot x_2} = (x_4 + x_0) + \overline{x_2}$$

which is equal to \$x_4 + x_0 + \overline{x_2}\$.

You can always write a simple C program to see where did you go wrong.

Here you go:

#include &lt;stdio.h&gt;
#include &lt;stdint.h&gt;

int main(void) {

    uint8_t byte;

    /* A number of all possible combinations.
    For 5 variables it would be 0b11111 etc. */
    uint8_t MAX = 0b1111;

    /* Print header */
    printf("x4 x3 x2 x0 | f1 f2 f3  f\n");

    for (byte=0; byte&lt;=MAX; byte++)
    {
        /* Get individual bits (combinations) */
        uint8_t x0 = (byte &amp; (1&lt;&lt;0)) &gt;&gt; 0; /* my x0 is your x0 */
        uint8_t x1 = (byte &amp; (1&lt;&lt;1)) &gt;&gt; 1; /* my x1 is your x2 */
        uint8_t x2 = (byte &amp; (1&lt;&lt;2)) &gt;&gt; 2; /* my x2 is your x3 */
        uint8_t x3 = (byte &amp; (1&lt;&lt;3)) &gt;&gt; 3; /* my x3 is your x4 */

        /* Logic functions */
        uint8_t f1 = (x3 &amp;&amp; x1) || !((x2 || x1) &amp;&amp; x1 &amp;&amp; 0b1) || (x1 &amp;&amp; x0);
        uint8_t f2 = (x3 &amp;&amp; x1) || !((x2 || x1) &amp;&amp; x1) || (x1 &amp;&amp; x0);
        uint8_t f3 = (x3 &amp;&amp; x1) || !(x2 &amp;&amp; x1) || (!x1) || (x1 &amp;&amp; x0);

        /* Final solution */
        uint8_t f = (!x1) || x0 || x3;

        /* Print truth table */
        printf(" %d  %d  %d  %d |  %d  %d  %d  %d", x3, x2, x1, x0, f1, f2, f3, f);

        /* Print wrong line indicator */
        if ((f2!=f1) || (f3!=f1) || (f!=f1))
            printf(" &lt;");

        printf("\n");

    }


    return 0;
}