Let R and Q be elements of a free, associative, finitely generated algebra A‹X› over a field k. Assume that a leading homogeneous part Q v does not have two-sided divisors and RQ = QR and R v = Q t v . In this paper, the solutions of the equation Σ i x i Ry i = z in A‹X› are found and with their help, the identity theorem and Freiheitssatz for a finitely generated associative algebra k‹X; R = 0›with one defining relation are proved. As a consequence, similar theorems for Lie p-algebras with one defining relation are proved; these results are applied to the proof of the periodicity of cohomologies of Lie p-algebras with one defining relation.