# The result of linear congruence when coprime exists

Given the following linear congruence: $ax \equiv b \mod n$

In the case when GCD($a,n$)=1, is it true that the value of x can be found using Extended Euclidean Algorithm, i.e. $x$ = E-GCD($a,n$) ?

Yes, the algorithm will return $(u,v)\in\mathbb{Z}^2$ such that $au+nv=1$. Therefore, $x=ub$ is a solution of the given equation.