I failed at that. The 4 lux I had were not enough even with a marketplace so I needed 10%-20% lux. Started with 20% and then built some temples, cathedrals and courts in the size 12 semi-core cities (This lux rate wasn't enough in half-corrupt cities), then lowered to 10% but then started massive invasion wars and needed 20% again. I never managed to eliminate lux on republic unless I approach domination already.
In the best case I had 30% tax and 10% lux.
In worst case had 50% tax and 20% lux.
The AI coudn't pay gpt for my tech so I was forced to leave tax at 30% for maintenance and unit support. Of course with tax of 30% banks were good for some hard-core cities and for all metros (Added smith to the equation).
Regarding rates my rule for republic is lux no more then 20% and science no less then then 30%, for monarchy lux no more then 10% and science no less then 60%.
If you were the tech leader from the middle AA, how did you fail to capture . . . well whatever wonder you wanted? At this point you can pick and chose which you want/need for your VC and leaving the rest for the AI to waste their time building. Give the AI tech trades that lead them away from the wonders you are working on and let them build the rest.
If you don't have the ability to move the slider to 100% science or can't do it without going -gp, then that is the issue. I would suggest looking at where to cut maintenance and unit support (which was what everyone else is saying so I won't duplicate it here). The basic answer to your question - why can't you research faster - it is because you are spending 50+% on other things. If you are only researching at 30-50% through the entire game, then you will not excel at science.
Another thought - if you are dominating the research race by the mid-AA, up your difficulty level. The jump from regent to monarchy won't make a huge difference, but the AI should stay competative until the early MA. That will trim some time from your development.
One hint to the issue might be this:
then lowered to 10% but then started massive invasion wars and needed 20% again.
Offenseive wars are not usually healthy to a high research rate. Massive invasions need troops. Troops mean unit support. Wars=war weariness. Production is diverted to military units. The AIs involved in wars often slow down or lose the edge in research. There's less trading Etc.