I am doing some exercises on dynamic programming in order to get familar with this concept. I've noticed that most of the time it's not difficult to calculate the complexity of a program using dynamic programming since most of the time we are recursively calculating a function $f$.
Let's suppose this function $f$ has $3$ parameters. This function $f$ represent all the subproblems of the problem we want to solve.
Moreover we have a nice recursive definition of $f$, so we are able to link the subproblems between each other and understand how a certain subproblem can help calculating an other subproblem.
Now suppose that the first parameter of our function $f$ can't take a value larger than $n_1$, the second also can't take a value larger than $n_2$ and the third parameter can't take a value larger than $n_3$. Supposing that calculating $f(i,j,k)$ takes $\mathcal{O}(m)$ then the complexity of our program is : (since it's essentially means we have $ n_1 \cdot n_2 \cdot n_3$ subproblems and each of these takes $m$ operations of constant cost to calculate)
$$\mathcal{O}(m \cdot n_1 \cdot n_2 \cdot n_3)$$
Now here comes my problem. If my program wants to calculate the maximum value of something then I can for example do the following :
$$f(i,j,k) = \max\{ f(i+1,j,k) + 1, f(i+1,j,k)\}$$
The problem is that this is not tail recursive. So in order to make the program tail recursive an idea could be to add a forth paramters to the function $f$, hence now we have :
$$f(i,j,k,l) = \max\{f(i+1,j,k,l+1), f(i+1,j,k,l)\}$$
This way the function $f$ is tail recursive.
Yet, my question is : making the function $f$ tail-recursive adds a $4$-th paramaters and hence increase the number of subproblems, so the complexity of our function is now increased (see what I said above about the complexity of a dynamic program), and hence tail recursion is bad on dynamic programs ?
Thank you.