as used herein the term “ room temperature ” refers to a temperature of about 25 ° c . to about 35 ° c . according to one aspect of the present invention , there is provided a novel process for the preparation of rilpivirine of formula i : in the presence of tertiary amine and a suitable solvent to give ( e )- 3 -( 4 -( 2 - chloropyrimidin - 4 - ylamino )- 3 , 5 - dimethylphenyl ) acrylonitrile of formula iv ; and b ) reacting the ( e )- 3 -( 4 -( 2 - chloropyrimidin - 4 - ylamino )- 3 , 5 - dimethylphenyl ) acrylonitrile of formula iv with 4 - aminobenzonitrile of formula v in an acid and a solvent to give rilpivirine of formula i and optionally converting rilpivirine formed into the pharmaceutically acceptable acid addition salt of rilpivirine . the suitable solvent used in step ( a ) may preferably be a solvent or a mixture of solvents selected from methylene chloride , ethylene dichloride , chloroform , carbon tetrachloride , ethyl acetate , methyl acetate , isopropyl acetate , tert - butyl acetate , ethyl formate and methyl formate . more preferably the suitable solvents are methylene chloride and ethyl acetate . the tertiary amine used in step ( a ) may preferably be selected from n , n - diisopropylethylamine , triethylamine or trimethylamine , and more preferably the tertiary amine is n , n - diisopropylethylamine . preferably the solvent used in step ( b ) may be a solvent or a mixture of solvents selected from methanol , ethanol , isopropanol , tert - butyl alcohol , n - butanol , isobutyl alcohol , toluene , xylene , n - hexane , cyclohexane , methylene chloride , ethylene dichloride , chloroform , carbon tetrachloride , acetone , diethyl ketone , methyl ethyl ketone , methyl propyl ketone , methyl isobutyl ketone , methyl tert - butyl ketone , ethyl acetate , methyl acetate , isopropyl acetate , tert - butyl acetate , ethyl formate , methyl formate , tetrahydrofuran , diethyl ether , diisopropyl ether , tert - butyl methyl ether , dimethylformamide , n , n - dimethyl acetamide and dimethyl sulfoxide . more preferably the solvents are methanol , isopropanol , acetone , methylene dichloride , diisopropyl ether and ethyl acetate . the reaction in step ( a ) may preferably be carried out at ambient temperatures in the range from about 0 ° c . to 180 ° c ., more preferably the step ( a ) is carried out at about 25 ° c . to 150 ° c . the acid used in step ( b ) may preferably be selected from trifluoroacetic acid , acetic acid , p - toluenesulfonic acid or formic acid , and more preferably the acid is trifluoroacetic acid . the reaction in step ( b ) may preferably be carried out at an elevated temperature . the term “ elevated temperature ” refers to temperature at above 25 ° c . more preferably the step ( b ) is carried out at about 40 to 90 ° c . according to another aspect of the present invention , there is provided a novel compound of ( e )- 3 -( 4 -( 2 - chloropyrimidin - 4 - ylamino )- 3 , 5 - dimethylphenyl ) acrylonitrile of formula iv : the contents of rilpivirine hydrochloride and the impurities are determined by high performance liquid chromatography ( hplc ). the invention will now be further described by the following examples , which are illustrative rather than limiting . to a mixture of 2 , 4 - dichloropyrimidine ( 25 gm ) and ( e )- 3 -( 4 - amino - 3 , 5 - dimethylphenyl ) acrylonitrile hydrochloride ( 28 gm ) was added n , n - diisopropylethylamine ( 250 ml ) under stirring . the mixture was then heated to 140 to 150 ° c . and stirred for 55 to 60 hours . the solution was then cooled to room temperature and the solvent was distilled off under reduced pressure to provide a residual solid . to the residual solid was added ethyl acetate ( 1500 ml ) and water ( 1000 ml ). the reaction mass was stirred for 30 minutes at room temperature and then the layers were separated . the organic layer was dried with sodium sulfate and then concentrates to provide 30 gm of ( e )- 3 -( 4 -( 2 - chloropyrimidin - 4 - ylamino )- 3 , 5 - dimethylphenyl ) acrylonitrile . to a mixture of 2 , 4 - dichloropyrimidine ( 25 gm ) and ( e )- 3 -( 4 - amino - 3 , 5 - dimethylphenyl ) acrylonitrile hydrochloride ( 28 gm ) was added triethylamine ( 300 ml ) under stirring . the mixture was then heated to 140 to 150 ° c . and stirred for 55 to 60 hours . the solution was then cooled to room temperature and the solvent was distilled off under reduced pressure to provide a residual solid . to the residual solid was added ethyl acetate ( 1500 ml ) and water ( 1000 ml ). the reaction mass was stirred for 30 minutes at room temperature and then the layers were separated . the organic layer was dried with sodium sulfate and then concentrates to provide 26 gm of ( e )- 3 -( 4 -( 2 - chloropyrimidin - 4 - ylamino )- 3 , 5 - dimethylphenyl ) acrylonitrile . to a mixture of 2 , 4 - dichloropyrimidine ( 5 gm ) and ( e )- 3 -( 4 - amino - 3 , 5 - dimethylphenyl ) acrylonitrile hydrochloride ( 6 gm ) was added n , n - diisopropylethylamine ( 60 ml ) under stirring . the mixture was then heated to 140 to 150 ° c . and stirred for 55 to 60 hours . the solution was then cooled to room temperature and the solvent was distilled off under reduced pressure to provide a residual solid . to the residual solid was added methylene chloride ( 300 ml ) and water ( 250 ml ). the reaction mass was stirred for 30 minutes at room temperature and then the layers were separated . the organic layer was dried with sodium sulfate and then concentrates to provide 5 gm of ( e )- 3 -( 4 -( 2 - chloropyrimidin - 4 - ylamino )- 3 , 5 - dimethylphenyl ) acrylonitrile . to a mixture of ( e )- 3 -( 4 -( 2 - chloropyrimidin - 4 - ylamino )- 3 , 5 - dimethylphenyl ) acrylonitrile ( 20 gm ) as obtained in example 1 , 4 - aminobenzonitrile ( 8 . 5 gm ), isopropanol ( 200 ml ) and trifluoroacetic acid ( 10 ml ) were added at room temperature . the reaction mixture was then heated to 80 to 85 ° c . and stirred for 4 hours . the reaction mass was then cooled to 0 ° c . and ph was adjusted to 10 to 11 with aqueous ammonia solution . the separated solid was filtered and then dried to provide 21 gm of rilpivirine . to a mixture of ( e )- 3 -( 4 -( 2 - chloropyrimidin - 4 - ylamino )- 3 , 5 - dimethylphenyl ) acrylonitrile ( 40 gm ), 4 - aminobenzonitrile ( 17 gm ), isopropanol ( 400 ml ) and p - toluenesulfonic acid ( 20 ml ) were added at room temperature . the reaction mixture was then heated to 80 to 85 ° c . and stirred for 4 hours . the reaction mass was then cooled to 0 ° c . and ph was adjusted to 10 to 11 with aqueous ammonia solution . the separated solid was filtered and then dried to provide 40 gm of rilpivirine . rilpivirine ( 20 gm ; chromatographic purity : 96 . 5 %) as obtained in example 4 was suspended in a mixture of methanol and acetone ( 1 : 1 , 2000 ml ) and then heated to reflux for 1 hour to provide a clear solution . the solution was treated with charcoal and filtered through celite bed . the solvent was distilled off under reduced pressure to obtain a residual solid . to the residual solid was added methanol ( 200 ml ) and then heated to 60 to 65 ° c . to the solution was added a solution of hydrochloric acid in isopropanol ( 200 ml ) at 60 to 65 ° c . and stirred for 1 hour 30 minutes . the contents were cooled to room temperature and stirred for 30 minutes . the separated solid was filtered and then dried to provide 15 gm of rilpivirine hydrochloride . rilpivirine ( 20 gm ; chromatographic purity : 96 . 5 %) was suspended in a mixture of methanol and methyl ethyl ketone ( 1 : 1 , 2000 ml ) and then heated to reflux for 1 hour to provide a clear solution . the solution was treated with charcoal and filtered through celite bed . the solvent was distilled off under reduced pressure to obtain a residual solid . to the residual solid was added methanol ( 200 ml ) and then heated to 60 to 65 ° c . to the solution was added a solution of hydrochloric acid in isopropanol ( 200 ml ) at 60 to 65 ° c . and stirred for 1 hour 30 minutes . the contents were cooled to room temperature and stirred for 30 minutes . the separated solid was filtered and then dried to provide 14 gm of rilpivirine hydrochloride .