a) Let $a,b$ and $c$ be side lengths of a triangle with perimeter $4$. Show that
\[a^2+b^2+c^2+abc<8.\]
b) Is there a real number $d<8$ such that for all triangles with perimeter $4$ we have
\[a^2+b^2+c^2+abc<d \quad\]
where $a,b$ and $c$ are the side lengths of the triangle?
### Part (a)
We need to show that for side lengths \(a, b, c\) of a triangle with perimeter 4, the inequality \(a^2 + b^2 + c^2 + abc < 8\) holds.

1. **Ravi Substitution**:
   Let \(a = x + y\), \(b = y + z\), and \(c = z + x\) where \(x, y, z > 0\). This substitution is valid because any triangle's side lengths can be expressed in this form. The perimeter condition \(a + b + c = 4\) translates to:
   \[
   (x + y) + (y + z) + (z + x) = 4 \implies 2(x + y + z) = 4 \implies x + y + z = 2
   \]

2. **Expressing the inequality**:
   We need to show:
   \[
   (x + y)^2 + (y + z)^2 + (z + x)^2 + (x + y)(y + z)(z + x) < 8
   \]

3. **Expanding and simplifying**:
   \[
   (x + y)^2 + (y + z)^2 + (z + x)^2 = x^2 + y^2 + 2xy + y^2 + z^2 + 2yz + z^2 + x^2 + 2zx = 2(x^2 + y^2 + z^2) + 2(xy + yz + zx)
   \]
   \[
   (x + y)(y + z)(z + x) = (x + y + z)(xy + yz + zx) - xyz = 2(xy + yz + zx) - xyz
   \]

4. **Combining the terms**:
   \[
   2(x^2 + y^2 + z^2) + 2(xy + yz + zx) + 2(xy + yz + zx) - xyz = 2(x^2 + y^2 + z^2) + 4(xy + yz + zx) - xyz
   \]

5. **Homogenizing**:
   Since \(x + y + z = 2\), we can use this to homogenize the inequality:
   \[
   2(x^2 + y^2 + z^2) + 4(xy + yz + zx) - xyz < 8
   \]

6. **Simplifying further**:
   \[
   2(x^2 + y^2 + z^2) + 4(xy + yz + zx) - xyz < 8
   \]
   Since \(x, y, z > 0\), the term \(-xyz\) is always negative, making the left-hand side strictly less than 8.

Thus, we have shown that:
\[
a^2 + b^2 + c^2 + abc < 8
\]

### Part (b)
We need to determine if there exists a real number \(d < 8\) such that for all triangles with perimeter 4, the inequality \(a^2 + b^2 + c^2 + abc < d\) holds.

1. **Counterexample**:
   Consider the case where \(a = b = c = \frac{4}{3}\). This satisfies the perimeter condition \(a + b + c = 4\).

2. **Calculating the expression**:
   \[
   a^2 + b^2 + c^2 + abc = \left(\frac{4}{3}\right)^2 + \left(\frac{4}{3}\right)^2 + \left(\frac{4}{3}\right)^2 + \left(\frac{4}{3}\right)^3
   \]
   \[
   = 3 \left(\frac{16}{9}\right) + \left(\frac{64}{27}\right) = \frac{48}{9} + \frac{64}{27} = \frac{144}{27} + \frac{64}{27} = \frac{208}{27} \approx 7.7037
   \]

3. **Conclusion**:
   Since \(\frac{208}{27} \approx 7.7037\), which is less than 8, but very close to 8, we can see that for any \(d < 8\), there will be a triangle with perimeter 4 that violates the inequality \(a^2 + b^2 + c^2 + abc < d\).

Thus, no such \(d < 8\) exists.

The final answer is \( \boxed{ d = 8 } \)