Please capitalize where necessary: in 1881 he was invited to give a course of lectures at johns hopkins university in the usa, where his friend sylvester was professor of mathematics.
In 1881 he was invited to give a course of lectures at Johns Hopkins University in the USA, where his friend Sylvester was professor of mathematics.