First thing you want to do is put them in separate cages. From your post it sounds like you have both in a 40 gal tank. Separate them into smaller tanks with papertowel as the substrate. Make su re each has a basking temp ranging between 95-115F. A broad wide branch or stone is best, with different areas they can bask in with varing temperatures. The cool end of the tank should be in the mid to low 80's.
If you had them only for a week or two, they are still adjusting to their new homes and may not feel secure enough to eat. Make sure they have plenty of hides and if the tanks are in a high traffic area of the house, cover all but one side of the tank, to make them feel more secure. Get a fecal to a vet as soon as possible to make sure they are not suffering from parasites. Make sure they are well hydrated. I know some posters have suggested baths, but t his could add more stress to them right now. Try leaving a small dish of water in the cage, too small for them to crawl into but sturdy enough so it won't tip over if the dragon decides to run across it. Misting 2 - 3 times a day would be best.
For food, offer small crickets in a ceramic dish that is low enough the dragons can see inside and can get into the dish. You could put it near the basking spot so the dragon can easily see in. Crickets offered should be no bigger than the space between the dragons' eyes. Offer crickets 2-3 times a day. Fresh finely chopped greens (like those recommended at beautiful dragons) should be offered as well but it isn't unusual for young dragons not to take much interest in greens. Once the food is in the cage, leave the room to give the dragons privacy. They may eat better if there are no distractions.
If the dragons are showing noticable signs of loosing weight (indentation on the head, behind the eyes, hip bones showing or thin tail base), it may be necessary to force feed them. I recommend talking to a qualified reptile vet as force feeding can be stressful. A small bottle cap size amount of diluted gateraid may encourage the dragons to drink and the minerals/vitamines in gateraid will help stimulate appetite.
-----
PHLdyPayne