Let \(A\) be an algebra over a field \(K\) of characteristic zero, let \(\d_1, >..., \d_s\in \Der_K(A)\) be {\em commuting locally nilpotent} \(K\)-derivations such that \(\d_i(x_j)=\d_{ij}\), the Kronecker delta, for some elements \(x_1,..., x_s\in A\). A set of algebra generators for the algebra \(A^\d:= \cap_{i=1}^s\ker (\d_i)\) is found {\em explicitly} and a set of {\em defining relations} for the algebra \(A^\d\) is described. Similarly, given a set \(\s_1, ..., \s_s\in \Aut_K(A)\) of {\em commuting} \(K\)-automorphisms of the algebra \(A\) such that the maps \(\s_i-{\rm id_A}\) are {\em locally nilpotent} and \(\s_i (x_j)=x_j+\d_{ij}\), for some elements \(x_1,..., x_s\in A\). A set of algebra generators for the algebra \(A^\s:=\{a\in A | \s_1(a)=... =\s_s(a)=a\}\) is found {\em explicitly} and a set of defining relations for the algebra \(A^\s\) is described. In general, even for a {\em finitely generated noncommutative} algebra \(A\) the algebras of invariants \(A^\d \) and \(A^\s \) are {\em not} finitely generated, {\em not} (left or right) Noetherian and {\em does not} satisfy finitely many defining relations (see examples). Though, for a {\em finitely generated commutative} algebra \(A\) {\em always} the {\em opposite} is true. The derivations (or automorphisms) just described appear often in may different situations after (possibly) a localization of the algebra \(A\).