Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I want to find four numbers $a$, $b$, $c$, $d$ of the function $f(x)= \dfrac{a x + b}{c x + d}$ satisfying the conditions $f(-6)=4$, $f(-5)=5$, $f(1)=3$ and $f(2)=2$. I tried

f[x_] := (a x + b)/(c x + d);
Solve[{f[-6] == -4, f[-5] == -5, f[1] == 3, f[2] == 2}, {a, b, c, d}]

But I can not get the result. How to tell Mathematica to do that?

share|improve this question
add comment

3 Answers

up vote 11 down vote accepted

You have many possible solution satisfying:

Reduce[{f[-6] == -4, f[-5] == -5, f[1] == 3, f[2] == 2}, {a, b, c, d}]

b == -10 a && c == -a && d == -2 a && a != 0

To find a few of those:

FindInstance[{f[-6] == -4, f[-5] == -5, f[1] == 3, f[2] == 2}, {a, b, c, d}, Reals, 5]
{{a -> -235, b -> 2350, c -> 235, d -> 470}, 
 {a -> 415, b -> -4150, c -> -415, d -> -830}, 
{a -> 196, b -> -1960, c -> -196,  d -> -392}, 
{a -> 267, b -> -2670, c -> -267, d -> -534}, 
{a -> -167, b -> 1670, c -> 167, d -> 334}}
share|improve this answer
add comment
f[x_] := (a x + b)/(c x + d);
Solve[{f[-6] == -4, f[-5] == -5, f[1] == 3, f[2] == 2, 
  Sequence @@ Thread[-50 < {a, b, c, d} < 50]}, {a, b, c, d}, Integers]

(*
{{a -> -4, b -> 40, c -> 4, d -> 8}, 
{a -> -3, b -> 30, c -> 3, d -> 6}, 
{a -> -2, b -> 20, c -> 2, d -> 4},
{a -> -1, b -> 10, c -> 1, d -> 2}, 
{a -> 1, b -> -10, c -> -1, d -> -2}, 
{a -> 2, b -> -20, c -> -2, d -> -4},
{a -> 3, b -> -30, c -> -3, d -> -6}, 
{a -> 4, b -> -40, c -> -4, d -> -8}}
*)
share|improve this answer
add comment

Your math problem and your code have different conditions f(-6)=4 but f[-6]=-4. The coded conditions lead to an infinite set of solutions as stated by the others. Your math problem does not have any solutions.

First, notice that c and d cannot both be zero, because then you would be dividing by zero. Then compare

f[x_]:=(a x+b)/(c x+d);
Solve[{f[-6]==4,f[-5]==5,f[1]==3,f[2]==2},{a,b,c,d}]

g[x_,y_]:=(a x+b)-y(c x+d)==0;
equations = {g[-6, 4], g[-5, 5], g[1, 3], g[2, 2]};
Solve[equations, {a, b, c, d}]

The first code gives an empty set {}, i.e. the answer is no solution exists.

The second code gives {{a -> 0, b -> 0, c -> 0, d -> 0}}, i.e. only the trivial solution exists. But remember our first condition was that c and d cannot both be zero, so there is no solution.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.