Let $a$ be non zero real number. Find the area of the figure enclosed by the line $y=ax$, the curve $y=x\ln (x+1).$
1. **Find the points of intersection:**
   We need to find the points where the line \( y = ax \) intersects the curve \( y = x \ln(x+1) \). Setting these equal to each other, we get:
   \[
   ax = x \ln(x+1) \quad \text{for} \quad x \neq 0
   \]
   Dividing both sides by \( x \) (since \( x \neq 0 \)):
   \[
   a = \ln(x+1)
   \]
   Solving for \( x \):
   \[
   x + 1 = e^a \implies x = e^a - 1
   \]
   Therefore, the graphs intersect at \( x = 0 \) and \( x = e^a - 1 \).

2. **Set up the integral for the area \( A \):**
   The area between the curves from \( x = 0 \) to \( x = e^a - 1 \) is given by:
   \[
   A = \int_0^{e^a-1} (ax - x \ln(x+1)) \, dx
   \]

3. **Evaluate the integral:**
   We split the integral into two parts:
   \[
   A = \int_0^{e^a-1} ax \, dx - \int_0^{e^a-1} x \ln(x+1) \, dx
   \]

4. **Evaluate the first integral:**
   \[
   \int_0^{e^a-1} ax \, dx = a \int_0^{e^a-1} x \, dx = a \left[ \frac{x^2}{2} \right]_0^{e^a-1} = a \left( \frac{(e^a-1)^2}{2} \right) = \frac{a (e^{2a} - 2e^a + 1)}{2}
   \]

5. **Evaluate the second integral using substitution:**
   Let \( u = x + 1 \), then \( du = dx \) and when \( x = 0 \), \( u = 1 \); when \( x = e^a - 1 \), \( u = e^a \):
   \[
   \int_0^{e^a-1} x \ln(x+1) \, dx = \int_1^{e^a} (u-1) \ln u \, du
   \]
   Split the integral:
   \[
   \int_1^{e^a} (u-1) \ln u \, du = \int_1^{e^a} u \ln u \, du - \int_1^{e^a} \ln u \, du
   \]

6. **Evaluate \( \int u \ln u \, du \) using integration by parts:**
   Let \( v = \ln u \) and \( dw = u \, du \). Then \( dv = \frac{1}{u} \, du \) and \( w = \frac{u^2}{2} \):
   \[
   \int u \ln u \, du = \frac{u^2 \ln u}{2} - \int \frac{u^2}{2} \cdot \frac{1}{u} \, du = \frac{u^2 \ln u}{2} - \int \frac{u}{2} \, du = \frac{u^2 \ln u}{2} - \frac{u^2}{4}
   \]

7. **Evaluate \( \int \ln u \, du \) using integration by parts:**
   Let \( v = \ln u \) and \( dw = du \). Then \( dv = \frac{1}{u} \, du \) and \( w = u \):
   \[
   \int \ln u \, du = u \ln u - \int u \cdot \frac{1}{u} \, du = u \ln u - u
   \]

8. **Combine the results:**
   \[
   \int_1^{e^a} u \ln u \, du = \left[ \frac{u^2 \ln u}{2} - \frac{u^2}{4} \right]_1^{e^a} = \left( \frac{e^{2a} \ln e^a}{2} - \frac{e^{2a}}{4} \right) - \left( \frac{1 \cdot \ln 1}{2} - \frac{1}{4} \right) = \frac{a e^{2a}}{2} - \frac{e^{2a}}{4} + \frac{1}{4}
   \]
   \[
   \int_1^{e^a} \ln u \, du = \left[ u \ln u - u \right]_1^{e^a} = \left( e^a \ln e^a - e^a \right) - \left( 1 \ln 1 - 1 \right) = a e^a - e^a + 1
   \]

9. **Combine the integrals:**
   \[
   \int_0^{e^a-1} x \ln(x+1) \, dx = \left( \frac{a e^{2a}}{2} - \frac{e^{2a}}{4} + \frac{1}{4} \right) - \left( a e^a - e^a + 1 \right) = \frac{a e^{2a}}{2} - \frac{e^{2a}}{4} + \frac{1}{4} - a e^a + e^a - 1
   \]

10. **Final area calculation:**
    \[
    A = \frac{a (e^{2a} - 2e^a + 1)}{2} - \left( \frac{a e^{2a}}{2} - \frac{e^{2a}}{4} + \frac{1}{4} - a e^a + e^a - 1 \right)
    \]
    Simplify the expression:
    \[
    A = \frac{a e^{2a} - 2a e^a + a}{2} - \left( \frac{a e^{2a}}{2} - \frac{e^{2a}}{4} + \frac{1}{4} - a e^a + e^a - 1 \right)
    \]
    \[
    A = \frac{a e^{2a}}{2} - a e^a + \frac{a}{2} - \frac{a e^{2a}}{2} + \frac{e^{2a}}{4} - \frac{1}{4} + a e^a - e^a + 1
    \]
    \[
    A = \frac{e^{2a}}{4} - \frac{1}{4} + e^a - 1
    \]
    \[
    A = \frac{e^{2a} - 1}{4} + e^a - 1
    \]
    \[
    A = \frac{e^{2a} - 1}{4} + e^a - 1
    \]

The final answer is \(\boxed{\frac{e^{2a} - 1}{4} + e^a - 1}\)