The algorithm is developed in Computer algebra system, open source SageMath software which helps in finding the first integrals of ODEs of order 2 that admit Lie algebra so(3) and the first integrals of third-order ODEs that admit four or more than four symmetry generators. The application of algorithm is illustrated through examples. The advantage of the present algorithm is that, it is universal as SageMath is a free open-source mathematics software system licensed under the GPL. By giving input of values of infinitesimal generators in the interactive window the user get values of Qis and Wijks as output.